EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
June 16, 2024, 03:56:03 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
>
Enable or disable individual checkbox of a tree
Pages: [
1
]
« previous
next »
Print
Author
Topic: Enable or disable individual checkbox of a tree (Read 8153 times)
forum6691
Newbie
Posts: 39
Enable or disable individual checkbox of a tree
«
on:
September 21, 2014, 11:43:58 AM »
Hello
I have a tree with many nodes with checkbox.
When I select a checkbox, I call an asynchrone task which puts data in a array and when I deselect the same checkbox, I execute synchrone task which modify (delete) data from the same array.
I have a problem when I check/uncheck quickly the checkbox. The sync task is executed before the end of the async task and the behaviour is inccorect.
I can prevent this problem if I disable temporarily the checkbox (it becomes Grey tint as on microsoft Windows) and I enable the checkbox when the assync task is finished to prevent the user to modify the checkbox.
Unfortunately, I haven't seen in the documentation a means to achieve this.
Could you help me ?
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Enable or disable individual checkbox of a tree
«
Reply #1 on:
September 21, 2014, 04:56:36 PM »
You can use the 'onBeforeCheck' event to define how a node can be checked. When returning false in this event, the checking action will be aborted.
Code:
$('#tt').tree({
onBeforeCheck:function(node,checked){
if (somecondition){
return false;
}
}
})
Logged
forum6691
Newbie
Posts: 39
Re: Enable or disable individual checkbox of a tree
«
Reply #2 on:
September 23, 2014, 11:42:31 AM »
Thanks very much
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...