Forum
16:49
25/10/2010
I tried working around this issue by deleting and adding the edited row back to the table. The results were just as bad.
After running the following commands
/******Start Commands
console.log($('#435_ListingHistoryTable').jqGrid('getGridParam','data')); // Data Before editing
var Data = $('#435_ListingHistoryTable').jqGrid('getRowData',997);
$('#435_ListingHistoryTable').jqGrid('delRowData',997);
console.log($('#435_ListingHistoryTable').jqGrid('getGridParam','data'));// Data after delete
Data.Notes = 'YES DOIN FINE';
$('#435_ListingHistoryTable').jqGrid('addRowData',997, Data);
console.log($('#435_ListingHistoryTable').jqGrid('getGridParam','data'));// Data after add
/******End Commands
I get the following results in firebug
/*****Start results
// Data Before editing
datatype: 'local',
colNames:[
'ID'
,''
,'Date'
,'Price'
,'History type'
,'Notes'
],
colModel :[
{name:'ID',hidden:true, key:true}
,{name:'LoadIcon',hidden:true,width:16}
,{name:'Date',width:65,sorttype:'date',datefmt:'m/d/Y'}
,{name:'Price',width:80}
,{name:'Type',width:134}
,{name:'Notes',width:275}],
gridComplete: function(){
},
ondblClickRow: function(selectedRow) {
},
rowNum: 999999,
width: 554,
height:'116',
altRows: true,
altclass: 'TableAlternate'
});
20:08
25/10/2010
So I found a work around.
It appears the underlying issue was in the GridParam Data not being updated correctly.
So instead of calling the setRowData command I wrote a little function that updated the underlying data and reloaded the grid.
Seems to work fine so far.
console.log($('#435_ListingHistoryTable').jqGrid('getGridParam','data'));
var Data = $('#435_ListingHistoryTable').jqGrid('getGridParam','data');
var RowData = $('#435_ListingHistoryTable').jqGrid('getRowData',997);
for(var i in Data ){
if (Data[i].ID == RowData.ID){
Data[i].Notes = '1 Already Done';
break;
}
}
$('#435_ListingHistoryTable').jqGrid('setGridParam','data', Data).trigger("reloadGrid");
console.log($('#435_ListingHistoryTable').jqGrid('getGridParam','data'));
Most Users Ever Online: 715
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66