简体   繁体   中英

DOJO: dojox.grid.TreeGrid + checkbox How to

Is it possible to place chceckboxes inside LazyTreeGrid ?

Maybe there is some plugin that would automatically update the selected object and fire onSelectionChanged event ?

Thanks for help.

The treegrid has a bug in terms of checkbox. { field: "isSelected",name: "Selected", width: "6em", editable:"true",alwaysEditing:"true",cellType:"dojox.grid.cells.Bool"} ,

Will show the checkbox. But it will not provide you the value when you check/uncheck the value.

To fix it, you need to do this: { field: "recvid",name: "Selected", width: "6em",formatter:formatCheckBox} ,

 function formatCheckBox(value,rowIndex) 
    {
        var icon;
        //var item = e.grid.getItem(rowIndex);
        //var itemName = item.itemName.toString();
        var id = value + "|" + 'Selected';
        //console.log(rowIndex + " "+value);

         if (rowIndex!=-1)
         {
          icon = "<input  style=\"vertical-align: middle;\" id='" + id + "' name='grid_item_checkbox' type='checkbox' />&#xA0;";
         }
        return icon;
    }

具有多状态复选框的Dijit树 (在Google搜索时显示为第一个结果)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM