0

I have a JQGRid tree. It loads data click by click, not all at once.

Typically, JQGRid passes 4 standard tree parameters with each call - row (level, parent, is leaf, is expanded). How can I pass more parameters that I will take from the row being expanded? E.g. data from Name column should be passed in AJAX call too. There doesn't seem to be OnExpand event or similar.

2 Answers 2

1

This is resolved by editing grid.treegrid.js

Method: expandNode : function(rc) { Lines: 344-355 

There we can insert custom query parameters before ajax call is made, into PostData array. E.g.

data = $(this).jqGrid("getRowData", rc.id); $(this).jqGrid("setGridParam",{postData:{customParam:escape(data.SomeColumn),nodeid:rc.id,parentid:rc.parent_id,n_level:rc.level}}); 
Sign up to request clarification or add additional context in comments.

Comments

0

jQuery(”#grid_id”).appendPostData( newdata) replaces or appends new parameters to the array. newdata should be array of type name;value

more: jqGrid Wiki

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.