MasterCheckbox should check only spaned rows.

Hi,

here in my snippet I have used spans, on checking master checkbox only first row of every span should get select, for a dynamic huge data,

In given snippet only 2 rows(name:subdata1 & name:subdata3) should get select not all 4.

How can I achieve this.

https://snippet.webix.com/0b43wfwh

Comments

  • edited July 11

    Hey @Komal, this is an expected behaviour of the master checkbox, to achieve your goal you'd have to redefine the default filtering method of the master checkbox. Please take a look at this example: https://snippet.webix.com/1vaw6g0h.
    In this case we're simply getting all of the odd entries in our list, you can adjust the conditions to whatever you find most suitable.

  • Thank You so much,
    Its working as per my conditions.

    One more thing I need with this,

    1. if after checking mastercheckbox I unselect any one of other checkbox,it should unselect Master Checkbox also.
    2. If I manually select all checkboxes it should select Master checkbox also.
      3.And this should be as per my span condition.
  • edited July 11

    To do this we'll have to modify the behaviour of masterCheckbox some more , for instance, we've added 4th argument true for onCheck to distinguish whether masterCheckbox was used or not. Don't forget that we also need to listen for the event itself on our datatable. When the onCheck event fires off the master checkbox will check if every sub checkbox was checked or not, if everything checks out(heh) we will check the master checkbox(and vice versa).
    I believe this example covers all of your points: https://snippet.webix.com/lzu4u2r5.

  • Thanks Its working fine, but i have to change datatable as treetable. Its working on snippet as datatable but not in my workspace. Hopefully there wont be any reflection of changing view.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion