get checked checkbox`s in list with activeContent

edited October 2018 in Technical questions

Hello. I need get all checked checkbox with id of row where the checkbox is located, and check checkbox by click in the row.
Please help me, I don't know how I can do this.

Tagged:

Comments

  • Hello,

    I need get all checked checkbox with id of row where the checkbox is located

    You can use data.each which allows iterating through all data available on the client side and get rows where checkboxes are checked.

     var ids = [];
          $$("mylist").data.each(function(obj){
            if(obj.markCheckbox)
              ids.push(obj.id)
          });
    

    check checkbox by click in the row

    First of all, here you need an event which will fire after the item was selected. So you can use onAfterSelect event.

     on:{
          onAfterSelect: function(id, obj){
            var item = this.getItem(id);
            var state = this.getItem(id).markCheckbox
            this.updateItem(id, {markCheckbox:!state});
          }
        },
    

    updateItem updates an item with new properties where we changed the state of checkbox

    Please check the sample: https://snippet.webix.com/j795zgt5

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!