onSelect MaterCheckbox cant get unvisible rows checkboxes in JS

Hi,

I check the MasterCheckbox of Datatable. When I check it I want then for each rows’ checkbox to get the value as it shows the input below. What I have seen is that only the visible rows are in DOM so I can’t get for the current page all the values of the checkboxes. There is any solution ?

<div role="gridcell" aria-rowindex="2" aria-colindex="1" class="webix_cell">
     <input value="3" class="webix_table_checkbox xlsexp" type="checkbox">
</div>

We implement a back-end ExcelExport using the ids from the selected rows. The thing is that the masterCheckbox select all checkboxes but only visible are in DOM.

Also we have checked the Webix toExcel function which runs nice but only for rendered records. So if you have 5000 records but only 1000 are rendered then 1000 will be exportet

Hi,

The Datatable adds to DOM only visible rows, that’s true. It is the lazy rendering technique, which ehnaces Datatable’s speed and performance.

At the same time you can access all its data by API. And the export methods work with the data rather than with DOM.

Check the following snippet, please: http://webix.com/snippet/65ee091e

Of course, if you load the data dynamically, and have loaded 1000 records out of 5000 ones available on server, the Datatable will process only loaded records.

Helga,

Can we use MasterCheckbox to select/check only current’s Page records ?

http://webix.com/snippet/a7c6b48b

Hello,

By default such behaviour is not possible, but a little bit of tuning can enable it. You need to:

  • create a custom master checkbox that is based on the default masterCheckbox, but works only with visible records as they belong to the currently visible page

  • handle the onAfterPageChange event of the Pager view and check/uncheck the master checkbox to synchonize it with page records.

You can see it in the following snippet: http://webix.com/snippet/699dc714.