EasyUI Forum
April 19, 2024, 11:57:59 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Checkbox issue with multiple datagrids (old easyUI version)  (Read 4630 times)
sectioni
Jr. Member
**
Posts: 67


View Profile
« on: October 28, 2018, 12:05:36 PM »

Hi,

I have a system with easyUI 1.5.1
I have styled it's checkboxes using the <label for="..."> css trick. (i've added a label element to your core)

When i have a page with a datagrid, and then i open a Modal with another datagrid, checking a checkbox in the Modal causes the checkbox to get checked in the datagrid underneath.
That's because both checkboxes have the same ID. (i.e. ck_2)

This issue does not reproduce with easyUI 1.6.2 since the ID of the second datagrid (in the Modal) is 'ck-1_2'.

So I'm assuming you've fixed it at some point.

Can you give me the specific code fix for that? Because I can't upgrade the framework on that system due to QA issues.

Thanks

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 28, 2018, 05:11:10 PM »

I have styled it's checkboxes using the <label for="..."> css trick. (i've added a label element to your core)

The checkboxes in the datagrid have no 'id' attribute. Could you please show an example to demonstrate your issue?
Logged
sectioni
Jr. Member
**
Posts: 67


View Profile
« Reply #2 on: October 29, 2018, 04:58:18 AM »

You're right.
It appears one of our developers added it using:

id="' + field + '_' + rowIndex + '"

inside:
renderRow: function(target, fields, frozen, rowIndex, rowData)

so for some reason rowIndex in 1.6.2 knows how to handle a situation with mulitple grids in the dom and 1.5.1 doesn't.

is there a way for me to add this fix to 1.5.1?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: October 29, 2018, 04:58:27 PM »

Please try to call this statement to generate the id value.
Code:
var id = $(target).data('datagrid').rowIdPrefix+'-'+field+'-'+rowIndex;
Logged
sectioni
Jr. Member
**
Posts: 67


View Profile
« Reply #4 on: October 31, 2018, 10:14:37 AM »

works. thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!