ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: resolvecomputing on January 30, 2018, 04:49:42 pm

Title: How can i set disabled any checkbox and get row selected in the Tree grid
Post by: resolvecomputing on January 30, 2018, 04:49:42 pm
Dear team
When i create tree grid i don't know how i can disabled and then a selected the root how can i get all seleted node in the tree in 2 case(the root closed or opened)

https://jsfiddle.net/linhluu/bh42c328/1/

Thanks you so much!
Title: Re: How can i set disabled any checkbox and get row selected in the Tree grid
Post by: resolvecomputing on January 31, 2018, 07:35:21 am
https://jsfiddle.net/linhluu/4sp7e1zj/
Title: Re: How can i set disabled any checkbox and get row selected in the Tree grid
Post by: paramvir on January 31, 2018, 10:28:19 am
The checked rows can be found by iterating through data and finding rows which have pq_tree_cb: true

https://paramquery.com/pro/api#option-treeModel

Code: [Select]
  $('#getrow').click(function() {
    // get row is checked
    var selected = grid.getData().filter(function(rd) {
      return rd.pq_tree_cb;
    }).map(function(rd) {
      return rd.name;
    })
    alert(selected);
  });

https://plnkr.co/edit/yqQ66QNMr7ycBIB4wQOx?p=preview
Title: Re: How can i set disabled any checkbox and get row selected in the Tree grid
Post by: paramvir on February 02, 2018, 07:43:17 pm
You may ignore the previous code as there is also a straightforward API to get checked rows in a treegrid

Code: [Select]
var selected = grid.Tree().getCheckedNodes()

https://paramquery.com/pro/api#method-Tree