Forum
15:54
11/12/2008
When clicking around in a grid (with multiselect set to false), the second row always retains the selected status. (looking in firebug shows that tr's class as "jqgrow selected")
Its not specific to the data in that row, because if I resort with a different column and get a different values in row 2, it also behaves the same.
I've done a quick screen grab to show what I'm talking about:
http://www.eci-usa.net/jggrid/demo.html
My jgGrid call is:
jQuery("#list").jqGrid(
{
url:"GetGroupMembers.do",
datatype: 'json',
mtype: 'GET',
colNames: colNames,
colModel: colModel,
pager: jQuery('#pager'),
rowNum:50,
hidegrid: false,
height: "auto",
shrinkToFit: false,
rowList:[10,20,30,50,100,200],
sortname: colModel[1].index,
sortorder: "desc",
viewrecords: true,
imgpath: 'jqGrid/themes/basic/images',
viewrecords: true,
multiselect: false,
}
);
(I'm building the column list and column model info dynamically, I can include that code if anyone wants it)
-Trevor
04:40
Moderators
30/10/2007
Hello Trevor,
Please check the id of the grid. Something is not good with the ids -
I mean some symbols or at least you have duplicated id's of the grid.
Remember - the id's should be uniquie.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:53
11/12/2008
tony said:
Hello Trevor,
Please check the id of the grid. Something is not good with the ids -
I mean some symbols or at least you have duplicated id's of the grid.
Remember - the id's should be uniquie.
Best Regards
Tony
Id of the grid or id for that row data?
I've simplified my html down to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<link rel="stylesheet" type="text/css" media="screen" href="jqGrid/themes/basic/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="jqGrid/themes/jqModal.css" />
<script type="text/javascript" src="scripts/jquery-1.2.6.js"></script>
<script src="jqGrid/jquery.jqGrid.js" type="text/javascript"></script>
<script src="jqGrid/js/jqModal.js" type="text/javascript"></script>
<script src="jqGrid/js/jqDnR.js" type="text/javascript"></script>
</head>
<body>
<div style="position: absolute; left: 0px; top: 30px; right: 0px; bottom: 10px; overflow: auto;">
<table id="list" class="scroll" style="width: 100%;"></table>
</div>
<script type="text/javascript">
function setupGrid( columninfo /* array of { title, name, width } */)
{
var colNames = [ ];
var colModel = [ ];
for(var i = 0; i < columninfo.length; i++)
{
colNames.push( columninfo[i].title );
var cm = { name: columninfo[i].name, index: columninfo[i].name, width: columninfo[i].width * 12, sortable: columninfo[i].sortable };
if ( cm.name == "__icon" ) cm.resizable = false;
colModel.push( cm );
}
jQuery("#list").jqGrid(
{
url:"GetGroupMembers.do",
datatype: 'json',
mtype: 'GET',
colNames: colNames,
colModel: colModel,
pager: jQuery('#pager'),
rowNum:50,
hidegrid: false,
height: "auto",
shrinkToFit: false,
rowList:[10,20,30,50,100,200],
sortname: colModel[1].index,
sortorder: "desc",
viewrecords: true,
imgpath: 'jqGrid/themes/basic/images',
viewrecords: true,
multiselect: false,
}
);
}
jQuery(document).ready(
function()
{
$.getJSON("GetGroupColumnInfo.do", function(data)
{
setupGrid(data.columninfo);
} );
}
);
</script>
</body>
</html>
My column definition data can be viewed at http://www.eci-usa.net/jqgrid/coldata.txt and the rowdata is at http://www.eci-usa.net/jqgrid/jsondata.txt
The id of each row is being generated by a auto-inc number on the serverside (for testing), so its just 0…rowcount.
My column definitions do have spaces in the column name, dunno if thats relavant.
-Trevor
08:16
Moderators
30/10/2007
Hello,
The links that you provide here are not valid.
Also I apologize for this, but you should check the id's of the
returned rows. Some row ids may have same value or something
not correct. Also provide me a link to the proble, to tell you what is wrong
here
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:16
11/12/2008
My bad. Typo'ed jqgrid when creating the directory. The links should work now.
However, I think I've found the issue.
When my data has a row with id '0', it gets changed to 1 when the html is created, so indeed, there are 2 rows with a html id of '1'.
I'm guessing this happens because you try to auto-assign ids if a row doesn't have one, and doing an "if ( rowdata[id] )" is failing because its a zero?
-Trevor
02:25
Moderators
30/10/2007
Hello,
In the jqGrid code there is no checking of if(rowdata[id])...
If this happens with the examples of the demo - so it is my bad.
If there are no id jqGrid begin to assign id's from 1.
So if you know that your id have 0 then you should perform additional
checking.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:29
Moderators
30/10/2007
Hello,
Thank you for this. Will be fixed. Never think that you use addRowData.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:24
Moderators
30/10/2007
Hello,
I hope that there are no more such code
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
62 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