I am using jqgrid treegrid to load the data remotely on expand event. It is retrieving the data fast but it is taking time to load on client side and also on collapsing the node, it is giving stop script error on IE8. On FF and Chrome, it does take time but works with out any script errors. I only have 480 records to display but treegrid shows huge performance drawback. IE8 error on collapsing FEB-2012 node...
相关问题
- How to bind a dropdown list inside jqgrid row cell
- jQgrid filterToolbar fails with searchOnEnter
- Detecting checkbox event in jqGrid cell
- How to alter data received from the server before
- How to access other row data from a cell's cus
相关文章
- jqGrid Row Object in onSelectRow
- Weird behavior of jqgrid Grouping
- jQuery - jqGrid - submit buttons in each row
- JqGrid: sorting of local data
- How to Expand/Shrink row in Jqgrid dynamically
- VB.net FileUpload using Ajaxcall
- jqGrid addRowData doesn't work with grid as su
- How to turn off column highlighting (on hover) for
I tested your demo and I have one tip hot to improve the performance dramatically. The reason are the line inside of expandRow:
and another line inside of collapseRow:
The lines uses
$t.grid.bDiv
as the jQuery context parameter. It follows that the data from$t.grid.bDiv
fill be searched without using the index existing for ids. In case of the grid has no id duplicates (which would be a bug in the data) one can remove the$t.grid.bDiv
parameterThe demo is identical to your original demo, but I used the fixed code of the function where the above lines are replaced to
and
I used the original jqGrid 4.1.1
jquery.jqGrid.min.js
, but overwrote the code only theexpandRow
andcollapseRow
function withI think that one can more improve performance of the code, but at least the simple change can improve dramatically the performance of collapsing or expanding of tree nodes having many items.
UPDATED: I posted just now the pull request which fix the described above problem in the main code of jqGrid. I decided to use
$($t.rows.namedItem(id))
instead of described above $("#"+$.jgrid.jqID(id)). I didn't measure the performance exactly, but the usage of namedItem should be the most close to the original jqGrid code and I hope it works a little more quickly as id selector of jQuery.UPDATED 2: The fix is now in the main code of jqGrid on the github (see here)