1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    1
    Vote Rating
    0
    Toams is on a distinguished road

      0  

    Default Saving order after Drag and drop in a TreePanel<ModelData>

    Saving order after Drag and drop in a TreePanel<ModelData>


    Hi,

    I try to save the order of the elements of a treePanel<ModelData> in order to reproduce this ordre later. (I already developpe the server side).
    When I want to set the new order for each element

    When I try to update the position of each elem the list I have do not contains
    the operation I could make. It is exactly the same list in the same order than when I create the store..

    Code:
    model = new ModelPopup(listeModel, true);
    store = new TreeStore<ModelData>();
    store.add(model.getChildren(), true);
    
    final TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
    tree.setDisplayProperty("name");
    store.sort("order", SortDir.ASC);
    
     new TreePanelDragSource(tree);
            final TreePanelDropTarget target = new TreePanelDropTarget(tree){
            @Override
                public void onDragDrop(DNDEvent e) {
                    super.onDragDrop(e);
                    int i = 0;
                    // I try to update the position of each elem but the list have the order before the first sort 
                    for (ModelData Element : store.getAllItems()){
                        final ModelArbrePopup element = (ModelArbrePopup) Element;
                        element.setOrder(i);
                        GWT.log(element.getName());
                        i++;
                    }
                }
            };
            target.setAllowSelfAsSource(true);  
            target.setFeedback(Feedback.BOTH);

    I hope than someone could help me

    thanks

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Location
    Leipzig, Germany
    Posts
    75
    Vote Rating
    1
    A.Rothe is on a distinguished road

      0  

    Default


    I think, in the API docs you can find, that store.getAllItems() returns a list of all models without any order...

    ~Andre

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Leipzig, Germany
    Posts
    75
    Vote Rating
    1
    A.Rothe is on a distinguished road

      0  

    Default


    Try TreeStore.getRootItems() and TreeStore.getChildren(model, true) to build your own list. The method getModels() returns the same as getAllItems().

Thread Participants: 1

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..." hd porno faketaxi