I am trying to update a cell in jqgrid forever after loading. I know I can use setCell , but this only updates the value for this page. If I return to the page, if I do not explicitly execute another setCell for the cell, the old value is displayed. I also tried setRowData, but it seems to do the same. I am using loadonce since my approach is 1) loading data. 2) change of several data values based on some criteria. 3) display of changed values. As I use loadonce , there should be no way to constantly change the cell in this session?
UPDATE:
Introducing my code that does not give an error, but does not iterate over all the data:
var set = 0; .... gridComplete: function(data){ setData(); }, .... beforeRefresh: function(data){ set = 0; }, .... function setData(){ if(set == 1) return; ... //create hash up here var dataArray = jQuery("#grid").jqGrid('getGridParam', 'data'); var j = 1; for (var rows in dataArray) { var key = dataArray[rows].name; dataArray[rows].level = hashTable[key]; j++; } alert(j); }
This is not a cyclic movement over all elements of the array that are locally loaded. For example, if the page size is 30, alert(j) returns 30, regardless of how many places I loaded locally. However, if I update the graph, j is the correct number. Why is the behavior of getGridParam different in each case?
jquery jqgrid
WildBill Feb 04 '12 at 22:27 2012-02-04 22:27
source share