Hi Jean,
Greetings from
Syncfusion support.
We have achieved your
requirement by using the Dropdown Tree component change
event. Within that event, we have added e-disable class to the list items based
on the selected items count. Check out the code snippet below.
|
const onChange = (args) => {
if
(args.value.length > 5) {
var elements = document.querySelectorAll("[aria-checked='false'");
for (var i = 0; i < elements.length;
i++) {
//Disable all the other nodes if count is
above 5 items.
elements[i].closest('li').classList.add('e-disable');
}
} else {
var elements = document.querySelectorAll('.e-disable');
for (var i = 0; i <
elements.length; i++) {
//Enable all the nodes if count is less than
5 items.
elements[i].classList.remove('e-disable');
}
}
};
|
Sample: https://stackblitz.com/edit/react-jzrgst?file=index.js
Check out the shared
sample and get back to us if you need any further assistance.
Regards,
Indhumathy L