Announcement

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

    Circle in tree connectors - how to get rid of it ? (BUG?)

    I am using a tree with all nodes looking like folders (no leaves) (something like explorer).
    The problem is, in a particular configuration a circle sign appears instead of a connector.

    How can I remove the little ugly circle displayed before Item2 ?

    Thanks in advance,

    Remi

    the code to reproduce this
    Code:
    public class MainModule implements EntryPoint {
    
        public void onModuleLoad() {
            Canvas canvas = new Canvas();
            canvas.draw();
    
            final IButton stretchButton = new IButton("SHOW TREE");
            stretchButton.setWidth(150);
            stretchButton.setShowRollOver(true);
            stretchButton.setShowDisabled(true);
            stretchButton.setShowDown(true);       
                stretchButton.addClickHandler(new ClickHandler() {
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {        
                    final Window winModal = new Window();
                    winModal.setWidth(360);
                    winModal.setHeight(600);
                    winModal.setTitle("Modal Window");
                    winModal.setShowMinimizeButton(false);
                    winModal.setIsModal(true);
                    winModal.setShowModalMask(true);
                    winModal.centerInPage();
    
                    DynamicForm form = new DynamicForm();
                    form.setHeight100();
                    form.setWidth100();
                    form.setPadding(5);
                    form.setLayoutAlign(VerticalAlignment.BOTTOM);
                    TextItem textItem = new TextItem();
                    textItem.setTitle("Text");
                    DateItem dateItem = new DateItem();
                    dateItem.setTitle("Date");
                    DateItem dateItem2 = new DateItem();
                    dateItem2.setTitle("Date");
                    dateItem2.setUseTextField(true);
                    form.setFields(textItem, dateItem, dateItem2);
    
    
                    Tree tree = new Tree();
                    TreeNode[] treeNodes = new TreeNode[4];
                    treeNodes[0] = new TreeNode();
                    treeNodes[0].setID("0");
                    treeNodes[0].setTitle("root");
                    treeNodes[0].setIsFolder(true);
    
                    treeNodes[1] = new TreeNode();
                    treeNodes[1].setTitle("item1");
                    treeNodes[1].setID("1");
                    treeNodes[1].setParentID("0");
                    treeNodes[1].setIsFolder(true);
    
                    treeNodes[2] = new TreeNode();
                    treeNodes[2].setTitle("item2");
                    treeNodes[2].setID("2");
                    treeNodes[2].setParentID("0");
                    treeNodes[2].setIsFolder(true);
                    //add empty children array to avoid displaying plus sign (+) if there are no sub-leaves
                    TreeNode[] emptyChildrenArray = new TreeNode[]{};
                    treeNodes[2].setChildren(emptyChildrenArray);
    
                    treeNodes[3] = new TreeNode();
                    treeNodes[3].setTitle("item11");
                    treeNodes[3].setID("3");
                    treeNodes[3].setParentID("1");
                    treeNodes[3].setIsFolder(true);
                    //add empty children array to avoid displaying plus sign (+) if there are no sub-leaves
                    TreeNode[] emptyChildrenArray2 = new TreeNode[]{};
                    treeNodes[3].setChildren(emptyChildrenArray2);
    
                    tree.setModelType(TreeModelType.PARENT);
                    //tree.setIdField("folderId");
                    //tree.setParentIdField("parentFolderId");
                    tree.setNameProperty("displayName");
                    tree.setRootValue("1");
                    tree.setData(treeNodes);
    
    
                    TreeGrid folderTreeGrid = new TreeGrid();
                    folderTreeGrid.setWidth(360);
                    folderTreeGrid.setHeight(300);
    
                    folderTreeGrid.setData(tree);
                    folderTreeGrid.setShowConnectors(true);
                    folderTreeGrid.setShowFullConnectors(false);
                    folderTreeGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);
                    folderTreeGrid.setPreventDuplicates(false);
    
                    form.addChild(folderTreeGrid);
    
                    winModal.addItem(form);
                    winModal.show();
                }
    
    
            });
            canvas.addChild(stretchButton);
        }
    }
    SmartGWT 2.2
    Attached Files
Working...
X