Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>var scrollPosition = 0 function RefreshGridData() { scrollPosition = jQuery("#griditems").closest(".ui-jqgrid-bdiv").scrollTop() $("#griditems").trigger("reloadGrid"); } </code></pre> <p>after data is loaded in event loadComplete</p> <pre><code>jQuery("#griditems").closest(".ui-jqgrid-bdiv").scrollTop(scrollPosition) </code></pre> <p><strong>EDIT :</strong></p> <pre><code>var ids = new Array(); jQuery("#jqgrid_id").jqGrid({ ... gridComplete: function(){ var rowIds = $("#jqgrid_id").getDataIDs(); $.each(ids, function (index, data) { if (data == 1){ $("#jqgrid_id").expandSubGridRow(rowId); } }); }, subGridRowExpanded: function(pID, id){ ids[id] = 1; }, subGridRowColapsed: function(pID, id){ ids[id] = 0; }, ... }); </code></pre> <p>not sure if this will work i didn't test it tut it should be something like that </p> <p><strong>EDIT</strong> </p> <p><strong>setGridParam</strong> - not suire if it will work on events but you might try that </p> <p>i couldn't find how to attach subGridRowExpanded topick using tag library in struts but try changing config after grid is constructed by taglibrary </p> <pre><code>$("#griditems").setGridParam({subGridRowExpanded: function(pID, id){ ids[id] = 1;}}); $("#griditems").setGridParam({subGridRowColapsed: function(pID, id){ ids[id] = 0;}}); $("#griditems").setGridParam({gridComplete: function(){ var rowIds = $("#jqgrid_id").getDataIDs(); $.each(ids, function (index, data) { if (data == 1){ $("#jqgrid_id").expandSubGridRow(rowId); } }); }}); </code></pre> <p><strong>EDIT</strong></p> <p>ok different aproach :</p> <pre><code>var scrollPosition = 0 var ids = new Array(); function RefreshGridData() { ids = new Array(); $('tr:has(.sgexpanded)').each(function(){ids.push($(this).attr('id'))}); scrollPosition = jQuery("#griditems").closest(".ui-jqgrid-bdiv").scrollTop() $("#griditems").trigger("reloadGrid"); } </code></pre> <p>and when load of grid is complete :</p> <pre><code>jQuery.each(ids, function (id,data) { $("#jqgrid_id").expandSubGridRow(data); jQuery("#griditems").closest(".ui-jqgrid-bdiv").scrollTop(scrollPosition); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload