EasyUI Forum
September 13, 2025, 10:32:41 PM *
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 selected rows  (Read 8763 times)
ndtdnc
Newbie
*
Posts: 4


View Profile Email
« on: February 20, 2015, 07:55:31 AM »

Dear,

I have datagrid with checkbox. So i want to do as below
if i selected one row have one panel 1 show.
if i selected 2 rows or more, have panel 2 show and panel 1 hide.

I think about count many rows selected, but i just use easyui, so i need your help.

Plz help me,
thank you!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 20, 2015, 05:46:15 PM »

You can call 'getSelections' method to check the selected rows count.
Code:
$('#dg').datagrid({
    onSelect: function(index,row){
        var count = $(this).datagrid('getSelections').length;
        console.log(count)
    }
})
Logged
ndtdnc
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: February 21, 2015, 01:07:18 AM »

Yeah. I mean that. And it worked.
Thank mate. Cheesy
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!