when using source with specified id column
var source =
{
datatype: "json",
datafields: [ { name: 'test', type: 'string' }, ... ],
id: "id",
url: url
};
$(“#jqxgrid”).jqxGrid(‘getrowdata’, clickedRowNr).uid is as specified in json. So far, so good.
But when you use filtertype:’list’ on any column, record.uid gets corrupted and is counted starting from 0.
$("#jqxgrid").jqxGrid(
{
source: adapter,
filterable: true,
sortable: true,
autoshowfiltericon: true,
columns: [
{ text:'Test', datafield: 'test', filtertype:'list', width: 180 }, ...
]
});
The reason, I’ve found, is creating local dataadapter in jqxgrid.filter.js -> _getfilterdataadapter which has not set id field in source. Newly created dataadapter from this local source tries again to get new uid and failed – overwriting regular uid.
Fix, that helped me, is adding id:'uid',
into localy created source, that is passed to new dataadapter. I think it won’t harm anything as the uid should already be handled by previous datafetch, but as I have only minified code, I cannot confirm it.