Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    how to get selection in CheckboxTree

    Hello,

    i'm using
    Code:
     
    TreeGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
    and i'am trying to handle the selection in these Checbox,i mean having the checkbox selected in a record for example.
    i noticed that i can use :

    Code:
     TreeGrid.getSelection();
    but i am not sure of what contains this ListGridRecord[]
    my tree is set with

    Code:
      TreeNode[] employeeData = new TreeNode[] {  
                 new EmployeeTreeNode("4", "1", "Charles Madigen", "Chief Operating Officer", true),  
               new EmployeeTreeNode("189", "4", "Gene Porter", "Mgr Tech Plng IntIS T", false),  
                new EmployeeTreeNode("265", "189", "Olivier Doucet", "Asset Spec Lines Stns", false),  
               new EmployeeTreeNode("264", "189", "Cheryl Pearson", "Dsl Sys Rep", false),  
                new EmployeeTreeNode("188", "4", "Rogine Leger", "Mgr Syst P P", true)  
       };
    where the first field is the Id and the second one,is the Id Parent.
    it is possible to get in some way, when selecting the node with the Id and IdParent ?

    #2
    an other question that may helps to make my first one clearer :
    is TreeGrid.getSelection() ; will returns a ListGridRecord with the selectedItems with their ID and Id Parent ,boolean like i already set them ?

    Comment


      #3
      A ListGridRecord you can think of like a HashMap, so every field in your tree node's, ...id, parentid, name, description, whatever, you can easily access via ListGridRecord.getAttribute("id"). In fact if your id is a integer then there are methods like ListGridRecord.getAttributeAsInt("id") to do the conversion for you.

      Comment

      Working...
      X