Package com.extjs.gxt.ui.client.widget.treegrid.TreeGrid

Examples of com.extjs.gxt.ui.client.widget.treegrid.TreeGrid.TreeNode


    event.setCancelled(false);
  }

  @Override
  protected void showFeedback(DNDEvent event) {
    final TreeNode item = treeGrid.findNode(event.getTarget());
    if (item == null) {
      if (activeItem != null) {
        clearStyle(activeItem);
      }
    }

    if (item != null && event.getDropTarget().component == event.getDragSource().component) {
      TreeGrid source = (TreeGrid) event.getDragSource().component;
      List<ModelData> list = source.getSelectionModel().getSelection();
      ModelData overModel = item.getModel();
      for (int i = 0; i < list.size(); i++) {
        ModelData sel = list.get(i);
        if (overModel == sel) {
          Insert.get().hide();
          event.getStatus().setStatus(false);
          return;
        }
        List<ModelData> children = treeGrid.getTreeStore().getChildren(sel, true);
        if (children.contains(item.getModel())) {
          Insert.get().hide();
          event.getStatus().setStatus(false);
          return;
        }
      }
    }

    boolean append = feedback == Feedback.APPEND || feedback == Feedback.BOTH;
    boolean insert = feedback == Feedback.INSERT || feedback == Feedback.BOTH;

    if (item == null) {
      handleAppend(event, item);
    } else if (insert) {
      handleInsert(event, item);
    } else if ((!item.isLeaf() || allowDropOnLeaf) && append) {
      handleAppend(event, item);
    } else {
      if (activeItem != null) {
        clearStyle(activeItem);
      }
View Full Code Here


  }

  @Override
  @SuppressWarnings({"unchecked", "rawtypes"})
  protected void onDragStart(DNDEvent e) {
    TreeNode n = treeGrid.findNode((Element) e.getDragEvent().getStartElement());
    if (n == null) {
      e.setCancelled(true);
      return;
    }
    ModelData m = n.getModel();
    if (!treeGrid.getTreeView().isSelectableTarget(m, (Element) e.getDragEvent().getStartElement())) {
      e.setCancelled(true);
      return;
    }
View Full Code Here

    if (GXT.isAriaEnabled()) {
      getRow(idx).setAttribute("aria-expanded", "true");
    }

    for (ModelData child : children) {
      TreeNode cn = findNode(child);
      if (cn.isExpanded()) {
        expand(cn);
      }
    }
    tree.refresh(node.m);
  }
View Full Code Here

    return sb.toString();
  }

  public boolean isSelectableTarget(ModelData model, Element target) {
    TreeNode node = findNode(model);
    if (node != null) {

      Element j = getJointElement(node);
      if (j != null && DOM.isOrHasChild(j, target)) {
        return false;
View Full Code Here

    onIconStyleChange(node, IconHelper.createStyle("x-tree3-loading"));
  }

  @Override
  protected void cleanModel(ModelData at) {
    TreeNode node = findNode(at);
    if (node != null) {
      node.clearElements();
    }
  }
View Full Code Here

  }

  @Override
  protected void onRemove(ListStore<ModelData> ds, ModelData m, int index, boolean isUpdate) {
    super.onRemove(ds, m, index, isUpdate);
    TreeNode node = findNode(m);
    if (node != null) {
      node.clearElements();
    }
  }
View Full Code Here

    event.setCancelled(false);
  }

  @Override
  protected void showFeedback(DNDEvent event) {
    final TreeNode item = treeGrid.findNode(event.getTarget());
    if (item == null) {
      if (activeItem != null) {
        clearStyle(activeItem);
      }
    }

    if (item != null && event.getDropTarget().component == event.getDragSource().component) {
      TreeGrid source = (TreeGrid) event.getDragSource().component;
      List<ModelData> list = source.getSelectionModel().getSelection();
      ModelData overModel = item.getModel();
      for (int i = 0; i < list.size(); i++) {
        ModelData sel = list.get(i);
        if (overModel == sel) {
          Insert.get().hide();
          event.getStatus().setStatus(false);
          return;
        }
        List<ModelData> children = treeGrid.getTreeStore().getChildren(sel, true);
        if (children.contains(item.getModel())) {
          Insert.get().hide();
          event.getStatus().setStatus(false);
          return;
        }
      }
    }

    boolean append = feedback == Feedback.APPEND || feedback == Feedback.BOTH;
    boolean insert = feedback == Feedback.INSERT || feedback == Feedback.BOTH;

    if (item == null) {
      handleAppend(event, item);
    } else if (insert) {
      handleInsert(event, item);
    } else if ((!item.isLeaf() || allowDropOnLeaf) && append) {
      handleAppend(event, item);
    } else {
      if (activeItem != null) {
        clearStyle(activeItem);
      }
View Full Code Here

  }

  @Override
  @SuppressWarnings({"unchecked", "rawtypes"})
  protected void onDragStart(DNDEvent e) {
    TreeNode n = treeGrid.findNode(e.getTarget());
    if (n == null) {
      e.setCancelled(true);
      return;
    }
    ModelData m = n.getModel();
    if (!treeGrid.getTreeView().isSelectableTarget(m, e.getTarget())) {
      e.setCancelled(true);
      return;
    }
View Full Code Here

    if (GXT.isAriaEnabled()) {
      getRow(idx).setAttribute("aria-expanded", "true");
    }

    for (ModelData child : children) {
      TreeNode cn = tree.findNode(child);
      if (cn.isExpanded()) {
        expand(cn);
      }
    }
    tree.refresh(node.m);
  }
View Full Code Here

    return sb.toString();
  }

  public boolean isSelectableTarget(ModelData model, Element target) {
    TreeNode node = tree.findNode(model);
    if (node != null) {

      Element j = getJointElement(node);
      if (j != null && DOM.isOrHasChild(j, target)) {
        return false;
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.treegrid.TreeGrid.TreeNode

Copyright © 2018 www.massapicom. 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.