1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    9
    Vote Rating
    0
    akshayrpin is on a distinguished road

      0  

    Default Unanswered: ReOrdering of child nodes within the parent

    Unanswered: ReOrdering of child nodes within the parent


    Hi
    i have created a Treepanel using a treestore. i need to reorder [move the child node up and down within the parent] on click of a button. is this possible ???

    i have been trying to achive the same by reomiving the seleted node and insert the same node again
    but the problem am facing is when i remove a node the code written after is not executing, even thoug the node gets deleted from the treepanel but a new node is not being added/inserted when debuged it
    I tried using a button upArrow

    upArrow
    .addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent ce) {
    BeanModel selItem = treePanel.getSelectionModel().getSelectedItem();
    BeanModel parent = treePanel.getStore().getParent(selItem);
    List<BeanModel> childrens = treePanel.getStore().getChildren(parent, true);
    for(BeanModel child : childrens){
    treePanel.getStore().remove(child); // this works well for the nodes not being selected, for selected node it throws Targetinvocationexception.
    }
    treePanel.getStore().add(parent, childrens, true); // Doesnt get executed at all
    }
    });

    let me know if any this is wrong or suggest me a proper solution for moving the children within the parent and i have to have this funcionality on click of a button.


    Untitled.png

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    9
    Vote Rating
    0
    akshayrpin is on a distinguished road

      0  

    Default


    got the solution i had added two listners for treePanel

    1 listner for Checkbox and also for TreePanel.getSelectionModel() listner so when tried to remove the node it was trying to remover the nodes twice.


    so removed one listner and added treepanel.onClick instead of getSelectionModel() listner.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    9
    Vote Rating
    0
    akshayrpin is on a distinguished road

      0  

    Default


    I am stuck up with another problem. when Expanding the node i am trying to sort the Childrens byt

    Collections.sort(childrens, new Comparator<BeanModel>() {
    @Override
    public int compare(BeanModel f1,
    BeanModel f2) {}});

    so after sorting i am removing the childrens from the Treepanel

    store.removeAll(parent); // removing as this was not sorted from the server.

    store.add(parent, childrens, true);// addign the sorted children based on the sequence value



    here i am able to get the Nodes displayed on the UI but the problem is not able to get the checkbox, inspite of

    treePanel.setCheckable(true);
    treePanel.setCheckNodes(CheckNodes.LEAF);
    treePanel.setAutoLoad(true);
    store.sort("defaultValue", SortDir.ASC);



    if i comment the bold part above checkbox is visible.

    let me know if am missing anything here

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."