EasyUI Forum
May 05, 2024, 06:40:15 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: datagrid getChecked only returns last row  (Read 9539 times)
phreeman
Newbie
*
Posts: 8


View Profile
« on: July 29, 2013, 03:34:01 PM »

In the datagrid documentation it states that the getChecked method "Return all rows where the checkbox has been checked. This method is available since version 1.3."

I have a datagrid with 3 rows checked (the number doesn't matter, just an illustration) and getData returns an object with .total = 3 and .rows = array of length 3. getChecked method only returns the last checked row (array of length 1 with data as object). My onCheckAll event iterates through each row and calls the checkRow method (which triggers the onCheckRow event). In this case only the first row is returned for getChecked as each row is selected.

Is this how it is suppose to work? If so, how can I get all rows that have been checked? I'm totaling a column from the datagrid, only if the row is checked, in a separate field in the form.

Thanks for your help.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 29, 2013, 07:30:07 PM »

Please refer to this example http://jsfiddle.net/yHdnH/. Click the 'GetChecked' button on top of datagrid and you will see it alert the exact checked rows number.
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!