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_Related Related Topics sp_TopicIcon
Bug in row selection - v 4.1
16/06/2011
16:43
Avatar
tkowalcz
Member
Members
Forum Posts: 6
Member Since:
31/05/2011
sp_UserOfflineSmall Offline

Hello everyone,

I have subgrid as a grid. When I select child grid - also parent row is selected (with the same id). Also two events (onSelectRow) are triggered for both grids.

Any clue Tony?

Regards, Tomasz

16/06/2011
17:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Which version is used?

Could you please3 prepare a exmple. If you do this, please do not forget to include non minified version

Thank you.

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

17/06/2011
10:59
Avatar
tkowalcz
Member
Members
Forum Posts: 6
Member Since:
31/05/2011
sp_UserOfflineSmall Offline

Hi Tony,

I don't have real version, but I've put simple example on server with ads (sorry for that):

http://www.tkowalcz.yoyo.pl/Test.htm

As in subject it's jqGrid 4.1

Best regards, Tomek

17/06/2011
13:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Thanks. Found the problem. Hummm very bad. Should make a option. If I fix this bug , then the jQuery live can not be used and vice versa - this is somthing like Catch 22 ..

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.

17/06/2011
13:17
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

It seems for me mostly like the wrong usage of row ids. One uses

data: [
    { "Variant_Auto_ID": "472", "Variant_ID": "test" },
    { "Variant_Auto_ID": "473", "Variant_ID": "test2" },
    { "Variant_Auto_ID": "474", "Variant_ID": "test3" },
    { "Variant_Auto_ID": "475", "Variant_ID": "test4"}
],
datatype: "local",
colNames: ['Variant_Auto_ID', 'Variant ID'],
colModel: [
    { name: 'Variant_Auto_ID', index: 'Variant_Auto_ID', width: 60, hidden: false },
    { name: 'Variant_ID', index: 'Variant_ID', width: 60, editable: true }
]

for the main grid without the usage of key:true or localReader:{id:'Variant_Auto_ID'}. So one has integers 1,2,3... as the row ids.

In the same way one uses

data: [
    { "Step_ID": "472", "Variant_ID": variant_id },
    { "Step_ID": "473", "Variant_ID": variant_id },
    { "Step_ID": "474", "Variant_ID": variant_id },
    { "Step_ID": "475", "Variant_ID": variant_id}
],
datatype: "local",
colNames: ['Step_ID', 'Variant_ID'],
colModel: [
    { name: "Step_ID", index: "Step_ID", width: 80, hidden: false },
    { name: "Variant_ID", index: "Variant_ID", width: 140, hidden: false }

and have the same integer row ids because of the same problem.

So for me the problem looks like the wrond usage of jqGrid and no jqGrid bug.

Best regards
Oleg 

17/06/2011
14:23
Avatar
tkowalcz
Member
Members
Forum Posts: 6
Member Since:
31/05/2011
sp_UserOfflineSmall Offline

Thanks OlegK

If I separate grid keys – it is fine, but:

1) These are separate grids, so there should be no connection between

2) I don't need to specify key.

3) If the Id's are the same for both grids – problem exists (look at current example code), I've left three same ids and one different 222

This means that it works fine unless parent grid Id is different than subgrid.

Probably workaround is to add extra column that will be a key. It would be constructed from SubgridId + id (I think that in one of versions it was like that).

Tomek

17/06/2011
16:00
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tomek,

corresponds to the HTML specification the ids of all elements must be unique on the page. You can easy solve the problem if you add in the data (but not in the column) of every grid the id proper

data: [
    { id:"m472", "Variant_Auto_ID": "472", "Variant_ID": "test" },
    { id:"m473", "Variant_Auto_ID": "473", "Variant_ID": "test2" },
    { id:"m474", "Variant_Auto_ID": "474", "Variant_ID": "test3" },
    { id:"m475", "Variant_Auto_ID": "475", "Variant_ID": "test4"}
],
datatype: "local",
colNames: ['Variant_Auto_ID', 'Variant ID'],
colModel: [
    { name: 'Variant_Auto_ID', index: 'Variant_Auto_ID', width: 60, hidden: false },
    { name: 'Variant_ID', index: 'Variant_ID', width: 60, editable: true }
]

and for the subgrid:

data: [
    { id:"s472", "Step_ID": "472", "Variant_ID": variant_id },
    { id:"s473", "Step_ID": "473", "Variant_ID": variant_id },
    { id:"s474", "Step_ID": "474", "Variant_ID": variant_id },
    { id:"s475", "Step_ID": "475", "Variant_ID": variant_id}
],
datatype: "local",
colNames: ['Step_ID', 'Variant_ID'],
colModel: [
    { name: "Step_ID", index: "Step_ID", width: 80, hidden: false },
    { name: "Variant_ID", index: "Variant_ID", width: 140, hidden: false }

You can construct the values of id propery using some prefix. Like "m" for main grid and "s" for the subgrid. If you can have many subgrids with the same data you can use "s1_", "s2_" prefixes or with any other rules.

Important only that at the end the page have to have no id duplicates.

Best regards
Oleg

17/06/2011
16:14
Avatar
tkowalcz
Member
Members
Forum Posts: 6
Member Since:
31/05/2011
sp_UserOfflineSmall Offline

OlegK said:

Hello Tomek,

corresponds to the HTML specification the ids of all elements must be unique on the page.


Thank you OlegK,

I did'n know that this is required to have unique id's per page. I will use what you suggested.

All the best, Tomek

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 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