EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 05, 2024, 06:40:15 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
datagrid getChecked only returns last row
Pages: [
1
]
« previous
next »
Print
Author
Topic: datagrid getChecked only returns last row (Read 9539 times)
phreeman
Newbie
Posts: 8
datagrid getChecked only returns last row
«
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
Re: datagrid getChecked only returns last row
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...