Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Second row doesn't release selection status
11/12/2008
15:54
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

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

11/12/2008
15:59
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

oh, didn't mention that I'm using jquery 1.2.6, and latest of jqGrid (as of last week).

-Trevor

12/12/2008
04:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

12/12/2008
09:53
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

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

12/12/2008
09:59
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

My brain hasn't been working full speed recently, so I apologize for not including this piece of info earlier:

I can also reproduce this under IE7.  (was using FF3)

14/12/2008
08:16
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

15/12/2008
12:16
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

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

16/12/2008
02:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

16/12/2008
11:10
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

Well, maybe not exactly if (... ), but there is something equivilent.  Just doing a quick check I'm finding:

row.id = rowid || t.p.records+1;

in $.fn.addRowData().

-Trevor

16/12/2008
11:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

16/12/2008
15:20
Avatar
trevorsharrison
Member
Members
Forum Posts: 13
Member Since:
11/12/2008
sp_UserOfflineSmall Offline

I don't directly use it.  I was just guessing that it was the piece of code responsible for adding rows to the table.

There may be other places in your code that do something similar to addRowData(), I just don't know.

-Trevor

17/12/2008
11:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I hope that there are no more such code Wink

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information