ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started 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!
-
https://jsfiddle.net/linhluu/4sp7e1zj/
-
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
$('#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
-
You may ignore the previous code as there is also a straightforward API to get checked rows in a treegrid
var selected = grid.Tree().getCheckedNodes()
https://paramquery.com/pro/api#method-Tree