English 中文(简体)
Can I set up a jqgrid treegrid so that it fetches the child data on row open? How?
原标题:

The example treegrid implementation isn t exactly crystal clear. I ve got a grid like:

  ID  Name    Val
+  1  Foo      45
+  2  Bar      30

Which I m populating from a json object. When you click on the +, I want to go to the server and get the data associated with that row s id:

  ID  Name    Val
-  1  FooBar   45
   -    Foo    20
   -    Bar    25
+  2  Baz      30

Are there any examples that show that more clearly? Also, the ones I m seeing seem to want you to fetch the whole data set in one go. Or is "adding" and "subtracting" rows a better way to go for this case?

Update: thinking a little further, I don t think the add/subtract method would be good, because it would kill sorting.

最佳回答

Probably Subgrid is what you need? Look at the demo and choose "Advanced" and then "Subgrid" of the left tree part. The demo use subGridUrl parameter with the server url. If you click for example on "+" from the row with id=6 the request to the subGridUrl will send. The request will contain nd_=1287002219148&id=6 as the additional parameters, where nd_ with the timestamp are used only to make every url unique and so switch local caching off.

问题回答

暂无回答




相关问题
Retrieving original row data from jqGrid

It is possible to use the getRowData method to retrieve the current of a cell but this retrieves the current cell content rather than the original data before it went through the formatter. How do I ...

How to programmatically select top row of JQGrid?

How does one programmatically select the top row of a JQGrid. I want to have the top row already selected when it is opened on the page. My grid is sorted by a descriptive column so the first row s id ...

Blank when NaN in jqGrid cells

How to set blank instead of NaN in jqGrid cells ? Using formatter ? Is there an example?

complete jqGrid?

Please, can anyone tell me how to use jqGrid? I want to do edit, add & delete functionality. Also I want to show an image in the grid Please tell me, what can I do, and how can I do?

jqGrid: is there an event for when columns are reordered?

I m using the column reordering feature in jqGrid $grid = jQuery("#list").jqGrid({ sortable:true, ... }); Is there an event that fires after columns are re-ordered? If there is, I can t see ...

Wrapping Text lines in JqGrid

Can you get lines of text to wrap in JqGrid? I have had a look round but i can t find anything.

using jqgrid style for usual Table in asp.net mvc

I d prefer using Table and td instead of JqGrid but i like JqGrid styles. has anyone used jqgrid style for usual Grid of asp.net MVC(i mean Table and td) before?

热门标签