For basic filter sample, it shows blank if none of the checkboxes is selected. How to show all records if none are selected?
Additionally, the “updIcon” method is not functioning correctly when used as is in a react project implementation. Is there a better sample to refer from? Kindly let me know
So, the only thing you need is to implement a logic that will define if the filtering should be applied. Probably, the easiest way is to check if the state of the filter checkboxes: if all of them are unchecked, you return true in the function.
The sample uses material icons, and the code was not written for React. So, it is expected that you need to use a different approach.
In React you need to use React state or add a listener from the Gantt configuration instead of the onclick event handler. Also, material icons should be added another way (at least there are native mui or material-ui packages that use the common React approach:
@ramil - The below event listener is written unchanged and it runs fine for my needed logic,
window.addEventListener(“click”, function (e) {
const filterCheckbox = e.target.closest(“.filterCheckbox”);
if (filterCheckbox) {
gantt.render();
}
});
But I am getting this error on screen each time I click checkbox to make a selection and can be dismissed with a close icon in the overlay: Uncaught TypeError: Cannot read properties of undefined (reading ‘getService’)
Hello Debjoy,
I couldn’t reproduce the issue in the snippet and in the demo I shared.
It is hard to suggest what might be wrong as I don’t see your code.
Please share a snippet or a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.
Hello Debjoy,
It is not necessary to remind about other questions on the forum. It doesn’t help to speed up the response time. And as I said before, you can submit a support request via email. In that case, the response time depends on the license type (though, usually, it is within 24 hours on business days):