Multiselect check box treetable with submenu checkbox hidden

edited February 13 in Technical questions

Hi,
I have one treetable grid with multiselect checkbox which contains submenu items. Problem i've is i'am not able to remove sub-menu item checkbox which is not required for me. I need checkbox only for parent nodes. I've used "master checkbox" for check-all, and template:'{common.checkbox()} for making rows check-able.

Tagged:

Comments

  • Hello,
    you can use template as function and custom checkbox. So it will look like

     template: function(obj, common){
                return  common.space(obj,common)
                  +common.icon(obj,common)
                  +(obj.$count ? common.checkbox(obj, common) : "")
                  +obj.value;              
              }
    

    Here is an example: https://webix.com/snippet/4ac8b4ef

    Or use treecheckbox

     template: function(obj, common){
                return  common.space(obj,common)
                  +common.icon(obj,common)
                  +(obj.$count ? common.treecheckbox(obj, common) : "")
                  +obj.value;              
              }
    

    Here is an example: https://webix.com/snippet/523950da

    Where {common.icon()}template adds '+'/'-' icons to the nodes,
    {common.space()} template adds indents in the hierarchy

  • edited February 14

    Hi,
    Thank you very much for the response which was really helpful for making me this snippet, please checkout my updated one:
    https://webix.com/snippet/c3793a67
    Now problem here is i'am not able to do check-all functionality in first column using master-checkbox.

  • Any one please update, whether it is possible or not.

  • Hi,
    I have had the same problem.
    Try to implement your masterTreeCheckbox filter with custom logic, and use it masterCheckbox instead. It works for me.
    Something like that
    https://webix.com/snippet/e8765687

  • edited February 15

    Thank you Victoria for your response.
    But how to make this check-all work?
    master.checkItem(parentnodeid) is not working for me like in the example.

  • edited February 15

    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

  • That worked, thank you very much.

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!