EasyUI Forum
May 05, 2024, 08:27:13 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: ctrlSelect in treegrid and dynamically changing singleSelect  (Read 10531 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: September 03, 2014, 01:33:41 PM »

Hey, I am using treegrid with the newest version of EasyUI 1.4.
Is there a reason that ctrlSelect does not work with treegrid while most of the properties extend from datagrid?

And also I noticed that when changing the singleSelect dynamically in datagrid everything works great and it changes
the selection method as wanted. But when trying the same in treegrid it does not change the selection method, Is it a bug?

(treegrid and datagrid both are configured with singleSelect : true on start)
This code works great in Datagrid:
Code:
$('#dg').datagrid('options').singleSelect = false;

This code does not work in treegrid:
Code:
$('#tt').treegrid('options').singleSelect = false;

both methods are called via onclick function.

I am in a position that I cant change to multiselect in treegrid dynamically and I cant use ctrlSelect but I dont want multiselect on start. What can I do?

Thanks.
« Last Edit: September 03, 2014, 01:42:09 PM by A-K » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 03, 2014, 06:30:02 PM »

Please try this:
Code:
$('#tt').treegrid({
  singleSelect: false
});
Or
Code:
$('#tt').datagrid('options').singleSelect = false;
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: September 04, 2014, 08:53:11 AM »

Thanks it works great. the second method is much better because it wont call onLoadSuccess again and the first method will..

And I also asked about ctrlSelect in treegrid, Is there a way to make it work? or will it be in the next version?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 04, 2014, 03:17:17 PM »

The 'ctrlSelect' property is inherited from datagrid, it also works in treegrid.
Code:
$('#tt').treegrid({
  singleSelect: false,
  ctrlSelect: true
});
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #4 on: September 04, 2014, 10:52:00 PM »

Thanks! The diffrence is if you put only ctrlSelect: true in datagrid everything works great
but in treegrid you have to put ctrlSelect: true and singleSelect: false. Maybe it should be added to the documentation of the
treegrid for the rest of the people that thought there is no ctrlSelect in treegrid.
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!