Forum


14:58

13/10/2009

We're seeing a problem where normal row selection with the mouse causes an exception after programmatically setting the selection using setSelection. The following code illustrates the issue.
Are we missing something?
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head>
<title></title>
<!–<script type=”text/javascript” src=”depend/json2-min.js”></script>–>
<script type=”text/javascript” src=”depend/jquery-1.3.2.min.js”></script>
<script type=”text/javascript” src=”depend/jQueryUI/jquery-ui-1.7.2.custom.min.js”></script>
<link rel=”Stylesheet” type=”text/css” href=”depend/jQueryUI/smoothness/jquery-ui-1.7.2.custom.css” />
<script type=”text/javascript” src=”depend/jqGrid/grid.locale-en.js”></script>
<script type=”text/javascript” src=”depend/jqGrid/jquery.jqGrid.min.js”></script>
<link rel=”Stylesheet” type=”text/css” href=”depend/jqGrid/ui.jqgrid.css” />
<script type=”text/javascript” >
$(function() {
$(”#testGrid”).jqGrid({
datatype: 'local',
height: 225,
width: 915,
multiselect: false,
gridview: true,
scrollRows: true,
colNames: [
'Index',
'Col1',
'Col2',
'Col3',
'Col4',
'Col5',
'Col6',
'Col7',
'Col8',
'Col9',
'Col10'
],
colModel: [
{ name: 'Index', index: 'Index', width: 100, sorttype: 'int' },
{ name: 'Col1', index: 'Col1', width: 100, sorttype: 'string' },
{ name: 'Col2', index: 'Col2', width: 100, sorttype: 'string' },
{ name: 'Col3', index: 'Col3', width: 100, sorttype: 'string' },
{ name: 'Col4', index: 'Col4', width: 100, sorttype: 'string' },
{ name: 'Col5', index: 'Col5', width: 100, sorttype: 'string' },
{ name: 'Col6', index: 'Col6', width: 100, sorttype: 'string' },
{ name: 'Col7', index: 'Col7', width: 100, sorttype: 'string' },
{ name: 'Col8', index: 'Col8', width: 100, sorttype: 'string' },
{ name: 'Col9', index: 'Col9', width: 100, sorttype: 'string' },
{ name: 'Col10', index: 'Col10', width: 100, sorttype: 'string' },
]
});
for (var i = 1; i < 51; i++) {
var item = { Index: i,
Col1: “Column 1″,
Col2: “Column 2″,
Col3: “Column 3″,
Col4: “Column 4″,
Col5: “Column 5″,
Col6: “Column 6″,
Col7: “Column 7″,
Col8: “Column 8″,
Col9: “Column 9″,
Col10: “Column 10″
};
$(”#testGrid”).addRowData(item.Index, item);
}
$(”#testGrid”).setSelection(5, true);
//Now selecting a row with the mouse causes an exception -> $t.p.selrow.replace is not a function
//Comment out the above line and row selection works perfectly
//We observed this behavior in both IE7 and FireFox
}
);
</script>
</head>
<body>
<table id=”testGrid”></table>
</body>
</html>
Thanks!
Most Users Ever Online: 715
Currently Online:
55 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