CheckAll not working in treetable

Below given is a snippet of a Tree-table with multi-select feature. I have removed the child node check-boxes intentionally. But now check-all is not checking all parent nodes. How to fix this?
https://webix.com/snippet/c3793a67

Hello!
The problem is that the template returned an empty string.
Just fix this:

template:function(obj, common, value, config, ind){
        if (obj.$level === 1) {                   
          return common.checkbox(obj, common, true, config);            
        } 
        else {
          return "" ;                    
        }
      };

Here is an example: https://webix.com/snippet/2f010710

Thank you for the fix.
Is it possible to uncheck the check-all button if any other row is checked, and make check-all check again if all the rows are checked?

Please give me an update on this.

Hello @sujith ,
So if you uncheck ,for example, one of the parent checkbox, the master checkbox will be unchecked too.
To implement such behavior we added source code of masterCheckbox and used some modifications as
added 4th parameter(true) for onCheck to distinguish whether masterCheckbox was used

master.callEvent("onCheck", [obj.id, config.columnId, checked, true]);

onCheck check: if masterCheckbox was used, process default logic or if its state has to be updated
Here is an example: https://webix.com/snippet/7fb68cc2

Hi team,

Sujith is one of my colleagues and we have implemented the checkbox column as you have suggested.
If I have 10000 records in the datatable, and if I selectAll, it nearly takes 13 secs to select. There is a huge performance dip. In our application, records may nearly go to 100 thousand records and beyond. In that case, browser crashes. Please find the snippet below for 100,000 records.

https://snippet.webix.com/cnoj0ipm

by the way, why is this storeUpdate event required? Even without this, selection works fine.
this.callEvent(“onStoreUpdated”, [obj.id, obj, “save”]);

Internally we observed, webix is calling render method while selecting rows, and that is causing the delay.

Hello @Nandeesh ,

In view of the fact that in this code select with custom css were used, it takes really a lot of time.

Firsly, to style selected items, it’s far more performant to just reset selection CSS rather than call the addRowCss method.

Secondly, you apply item-by-item selection in your checkMaster function even if checkbox is checked by a master, which triggers rendering of each item separately. Instead, you need to call the selectAll/unselectAll methods in filter refresh method.

Please check the sample with some changes: https://snippet.webix.com/0ovcwwsu

why is this storeUpdate event required?
This is necessary in order to keep the state of the checkbox on the server, if some save script is connected. If checkboxes are just visual thing, you can remove this event

Hi Nastja,

Thanks for the solution.
I faced one more issue with this code. If I use “areaselect” property, it again takes a lot of time. I have used 30000 records in this below snippet.

https://snippet.webix.com/gq3zxg86

If you comment areaselect property, or even if it is set to false, then the selection works well.

We further more investigated and came up with workaround, still we have the same issue with areaselect property.

https://snippet.webix.com/er2y7mbs

I have observed that, if areaselect is set to true, then selection takes longer than unselect. And if it is set to false, selection is faster than unselect. It seems strange but we couldn’t understand why it happened in that way!

Hello,
As you have a lot of data, I recommend using dynamic loading. This will greatly improve performance, as records will not be loaded at once.

Area selection is used to select visible records, however as the data is too long, the majority of it won’t be visible, so there is not much point in using area selection. For example, when the user has 100 records, it works well
https://snippet.webix.com/3oj18xwb

Maybe it helps but I just add that you can use shift-selection to select few rows
navigation:true
https://snippet.webix.com/blxvpw13

Hi Nastja,

Sorry for the delay in responding back to your solution.
As per the Webix documentation, to implement dynamic loading even the server side script has to be changed. Currently, it’s not possible from server side because it’s been handled by a different team. Isn’t it possible to handle it only within Webix?
In the same webix snippet we have tried one more way to mitigate this issue and it didn’t work.
https://snippet.webix.com/9o7z4jd9