Examples of TreeGrid


Examples of com.smartgwt.client.widgets.tree.TreeGrid

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        TreeGrid treeGrid = new TreeGrid();
        treeGrid.setWidth(300);
        treeGrid.setHeight(400);

        TreeGridField field = new TreeGridField("Name", "Tree from local data");
        field.setCanSort(false);

        treeGrid.setFields(field);

        Tree tree = new Tree();
        tree.setModelType(TreeModelType.PARENT);
        //tree.setRootValue("1");
        tree.setNameProperty("Name");
        tree.setIdField("EmployeeId");
        tree.setParentIdField("ReportsTo");
        tree.setShowRoot(true);

        EmployeeTreeNode root = new EmployeeTreeNode("4", "1", "Charles Madigen");
        EmployeeTreeNode node2 = new EmployeeTreeNode("188", "4", "Rogine Leger");
        EmployeeTreeNode node3 = new EmployeeTreeNode("189", "4", "Gene Porter");
        EmployeeTreeNode node4 = new EmployeeTreeNode("265", "189", "Olivier Doucet");
        EmployeeTreeNode node5 = new EmployeeTreeNode("264", "189", "Cheryl Pearson");
        tree.setData(new TreeNode[]{root, node2, node3, node4, node5});

        tree.setRoot(root);

        treeGrid.setData(tree);

        return treeGrid;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return record.getAttributeAsString("Job") + ": " + value;
            }
        });
       
        TreeGrid employeeTreeGrid = new TreeGrid();
        employeeTreeGrid.setWidth(500);
        employeeTreeGrid.setHeight(400);
        employeeTreeGrid.setNodeIcon("icons/16/person.png");
        employeeTreeGrid.setFolderIcon("icons/16/person.png");
        employeeTreeGrid.setAutoFetchData(true);
        employeeTreeGrid.setCanReorderRecords(true);
        employeeTreeGrid.setCanAcceptDroppedRecords(true);
        employeeTreeGrid.setShowOpenIcons(false);
        employeeTreeGrid.setDropIconSuffix("into");
        employeeTreeGrid.setClosedIconSuffix("");
        employeeTreeGrid.setData(employeeTree);
        employeeTreeGrid.setFields(formattedField);
       
        return employeeTreeGrid;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return record.getAttributeAsString("Job") + ": " + value;
            }
        });
       
        TreeGrid employeeTreeGrid = new TreeGrid();

        employeeTreeGrid.setWidth(500);
        employeeTreeGrid.setHeight(400);
        employeeTreeGrid.setNodeIcon("icons/16/person.png");
        employeeTreeGrid.setFolderIcon("icons/16/person.png");
        employeeTreeGrid.setCanReorderRecords(true);
        employeeTreeGrid.setCanAcceptDroppedRecords(true);
        employeeTreeGrid.setShowOpenIcons(false);
        employeeTreeGrid.setDropIconSuffix("into");
        employeeTreeGrid.setClosedIconSuffix("");
        employeeTreeGrid.setData(employeeTree);
        employeeTreeGrid.setFields(formattedField);
       
        return employeeTreeGrid;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

        employeeTree.setParentIdField("ReportsTo");
        employeeTree.setOpenProperty("isOpen");
        employeeTree.setData(employeeData);


        final TreeGrid employeeTreeGrid = new TreeGrid();
        employeeTreeGrid.setWidth(200);
        employeeTreeGrid.setHeight(240);
        employeeTreeGrid.setNodeIcon("icons/16/person.png");
        employeeTreeGrid.setFolderIcon("icons/16/person.png");
        employeeTreeGrid.setShowOpenIcons(false);
        employeeTreeGrid.setShowDropIcons(false);
        employeeTreeGrid.setClosedIconSuffix("");
        employeeTreeGrid.setData(employeeTree);
        employeeTreeGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
        employeeTreeGrid.setShowSelectedStyle(false);
        employeeTreeGrid.setShowPartialSelection(true);
        employeeTreeGrid.setCascadeSelection(true);

        employeeTreeGrid.addDrawHandler(new DrawHandler() {
            public void onDraw(DrawEvent event) {
                employeeTreeGrid.getTree().openAll();
            }
        });

        DynamicForm df = new DynamicForm();

        final CheckboxItem partialSelection = new CheckboxItem("partialSelect", "Allow Partial Selection");
        partialSelection.setDefaultValue(true);
        partialSelection.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                boolean selected = partialSelection.getValueAsBoolean();
                employeeTreeGrid.setShowPartialSelection(!selected);
                employeeTreeGrid.redraw();
            }
        });

        df.setFields(partialSelection);
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        TreeGrid treeGrid = new TreeGrid();
        treeGrid.setWidth(300);
        treeGrid.setHeight(400);

        TreeGridField field = new TreeGridField();
        field.setName("Name");
        field.setTitle("Tree from local data");
        field.setCanSort(false);

        treeGrid.setFields(field);

        Tree tree = new Tree();
        tree.setModelType(TreeModelType.PARENT);
        //tree.setRootValue("1");
        tree.setNameProperty("Name");
        tree.setIdField("EmployeeId");
        tree.setParentIdField("ReportsTo");
        tree.setShowRoot(true);

        EmployeeTreeNode root = new EmployeeTreeNode("4", "1", "Charles Madigen");
        EmployeeTreeNode node2 = new EmployeeTreeNode("188", "4", "Rogine Leger");
        EmployeeTreeNode node3 = new EmployeeTreeNode("189", "4", "Gene Porter");
        EmployeeTreeNode node4 = new EmployeeTreeNode("265", "189", "Olivier Doucet");
        EmployeeTreeNode node5 = new EmployeeTreeNode("264", "189", "Cheryl Pearson");
        tree.setData(new TreeNode[]{root, node2, node3, node4, node5});

        tree.setRoot(root);

        treeGrid.setData(tree);

        return treeGrid;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

        }
    }

    public Canvas getViewPanel() {
        //TODO fix sample
        final TreeGrid treeGrid = new TreeGrid();
        treeGrid.setLoadDataOnDemand(false);
        treeGrid.setWidth(500);
        treeGrid.setHeight(400);
        treeGrid.setDataSource(EmployeeXmlDS.getInstance());
        treeGrid.setNodeIcon("icons/16/person.png");
        treeGrid.setFolderIcon("icons/16/person.png");
        treeGrid.setAutoFetchData(true);


        TreeGridField nameField = new TreeGridField("Name", 150);
        TreeGridField jobField = new TreeGridField("Job", 150);
        TreeGridField salaryField = new TreeGridField("Salary");

        treeGrid.setFields(nameField, jobField, salaryField);
       
        treeGrid.addDataArrivedHandler(new DataArrivedHandler() {
            public void onDataArrived(DataArrivedEvent event) {
                treeGrid.getData().openAll();
            }
        });
       
        return treeGrid;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

                    new AnimateTreeNode("Lion")
                )
            )
        ));
       
        TreeGrid animalTreeGrid = new TreeGrid();
        animalTreeGrid.setData(animalTree);
        animalTreeGrid.setWidth(300);
        animalTreeGrid.setHeight(300);
        animalTreeGrid.setAnimateFolders(true);
        animalTreeGrid.setAnimateFolderSpeed(100);    
       
        VLayout layout = new VLayout();
        layout.setMembersMargin(10);
        layout.addChild(animalTreeGrid);
        return layout;
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

    public Canvas getViewPanel() {

        EmployeeXmlDS employeesDS = EmployeeXmlDS.getInstance();

        final TreeGrid treeGrid = new TreeGrid();
        treeGrid.setLoadDataOnDemand(false);
        treeGrid.setWidth(500);
        treeGrid.setHeight(400);
        treeGrid.setDataSource(employeesDS);
        treeGrid.setCanEdit(true);
        treeGrid.setNodeIcon("icons/16/person.png");
        treeGrid.setFolderIcon("icons/16/person.png");
        treeGrid.setAutoFetchData(true);
        treeGrid.setCanFreezeFields(true);
        treeGrid.setCanReparentNodes(true);       

        TreeGridField nameField = new TreeGridField("Name", 150);
        nameField.setFrozen(true);

        TreeGridField jobField = new TreeGridField("Job", 150);
        TreeGridField employeeTypeField = new TreeGridField("EmployeeType", 150);
        TreeGridField employeeStatusField = new TreeGridField("EmployeeStatus", 150);
        TreeGridField salaryField = new TreeGridField("Salary");
        TreeGridField genderField = new TreeGridField("Gender");
        TreeGridField maritalStatusField = new TreeGridField("MaritalStatus");

        treeGrid.setFields(nameField, jobField, employeeTypeField,employeeStatusField,
                salaryField, genderField, maritalStatusField);

        return treeGrid;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.tree.TreeGrid

    SectionStackSection section = new SectionStackSection();
    section.setCanCollapse(false);
    section.setExpanded(true);
    section.setResizeable(true);

    TreeGrid tree = new TreeGrid();
    tree.setWidth100();
    tree.setHeight100();
    tree.setAnimateFolderTime(100);
    tree.setAnimateFolders(true);
    tree.setAnimateFolderSpeed(1000);
    tree.setShowSortArrow(SortArrow.CORNER);
    tree.setShowAllRecords(true);
    tree.setLoadDataOnDemand(false);
    tree.setCanSort(false);
    tree.setCellHeight(17);
    tree.setShowHeader(false);

    TreeGridField field = new TreeGridField();
    field.setCanFilter(true);
    field.setName("name");
    field.setTitle("<b>SmartGWT Showcase</b>");
    tree.setFields(field);

    Tree treeData = new Tree();
    treeData.setModelType(TreeModelType.PARENT);
    treeData.setNameProperty("name");
    treeData.setOpenProperty("isOpen");
    treeData.setIdField("nodeID");
    treeData.setParentIdField("parentNodeID");
    treeData.setRootValue("root");
    treeData.setData(DemoData.getAddressBookTreeData());

    tree.setData(treeData);
    section.setItems(tree);

    setSections(section);
  }
View Full Code Here

Examples of org.jeecgframework.core.common.model.json.TreeGrid

      cq = new CriteriaQuery(TSType.class);
      cq.eq("TSTypegroup.id", treegrid.getId().substring(1));
      cq.add();
      List<TSType> typeList = systemService.getListByCriteriaQuery(cq, false);
      for (TSType obj : typeList) {
        TreeGrid treeNode = new TreeGrid();
        treeNode.setId("T"+obj.getId());
        treeNode.setText(obj.getTypename());
        treeNode.setCode(obj.getTypecode());
        treeGrids.add(treeNode);
      }
    } else {
      cq = new CriteriaQuery(TSTypegroup.class);
      List<TSTypegroup> typeGroupList = systemService.getListByCriteriaQuery(cq, false);
      for (TSTypegroup obj : typeGroupList) {
        TreeGrid treeNode = new TreeGrid();
        treeNode.setId("G"+obj.getId());
        treeNode.setText(obj.getTypegroupname());
        treeNode.setCode(obj.getTypegroupcode());
        treeNode.setState("closed");
        treeGrids.add(treeNode);
      }
    }

    return treeGrids;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.