Forum
14:27
10/09/2009
Hello,
if I create a local grid, fill it by json data, select a row and try to sort, two bugs appear:
1. Regardless of parameter "deselectAfterSort" the selected row isn't selected anymore.
2. During grid filling I gave each row an unique id (for example 'houselst10'). This changes after sorting. Maybe this is the reason for the bug above.
I use the grid version 3.8.1.
Here is the code of my grid:
datatype: "local",
autowidth: true,
gridview: true,
deselectAfterSort: false,
forceFit: true,
sortname: 'rowid'
});
$('#grid').jqGrid({
colNames: ['Id', 'Number', 'Description', 'Street', 'Zipcode', 'City', 'Renter'],
colModel: [{ name: 'rowid', hidden: true },
{ name: 'number', width: 80 },
{ name: 'description' },
{ name: 'street' },
{ name: 'zipcode', width: 60 },
{ name: 'city' },
{ name: 'renter'}]
});
var req = {"rows":[{"id":"5","housename":"","cell":["5","","","Kolpingstr. 32","33098","Paderborn","Dieter Unruh "]},{"id":"6","housename":"","cell":["6","","","Engelgasse 98","33100","Marienloh","Papst Benedigt "]},{"id":"3","housename":"1X055","cell":["3","1X055","Villa","Bonhoefferstr. 1","33175","Bad Lippspringe","Kruser Peter"]},{"id":"7","housename":"G14","cell":["7","G14","Building","Dedinghauserweg 18","33175","Bad Lippspringe","Udo Jauchzen"]}]};
var rowlength = req.rows.length;
for (var i = 0; i < rowlength; i++) {
rowData = { rowid: req.rows[i].cell[0],
number: req.rows[i].cell[1],
description: req.rows[i].cell[2],
street: req.rows[i].cell[3],
zipcode: req.rows[i].cell[4],
city: req.rows[i].cell[5],
renter: req.rows[i].cell[6]
};
$('#grid').addRowData('houselst' + req.rows[i].id, rowData);
}
Most Users Ever Online: 715
Currently Online:
27 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