1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
    doughboy is on a distinguished road

      0  

    Default Unanswered: GXT 2.2.5, drag-n-drop listener and comparator TreeStore priority

    Unanswered: GXT 2.2.5, drag-n-drop listener and comparator TreeStore priority


    I use GXT2.2.5
    I need to do some business logic with a drag-n-drop in the TreeStore. This action changes the value on what the Comparator is based on. The problem is that the sort is automatically called before the drag-and-drop event listner.
    1- user drag n drop an item in the tree (this changes the order);
    2- the TreeStore Comparator is called;
    3- the DNDListener is called;

    I wish that the Comparator was called after my DNDListener so the tree would be sort the right way.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Can you provide an example of what you are describing? The DNDListener has many handlers, some of which are clearly called before the drop is complete. Additionally, you haven't made it clear what you add the DNDListener to - both the source and the target fire those events, the source first, then the target.

    Remember too that events are used to find out that something has happened, not that it is about to happen. In the case of DNDListener.onDragDrop, you are being informed that the DnD operation was successful - at this time you might choose to save data back to the server. If this method went off before the drop was finished and you saved data, the change would not properly be stored. As such, you probably want to be customizing the DropTarget.onDragDrop details (overriding it and adding your details before calling super, for example) or if using TreePanelDropTarget, perhaps you'll want to override handleAppendDrop or handleInsertDrop.

    Another option could be to modify the comparator after the drop is complete and re-apply the sort. This would be more expensive, but might not matter much in your particular use case.

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
    doughboy is on a distinguished road

      0  

    Default


    I got rid of the comparator being automatically handled by the store. I call the sort when the dragNDrop event finishes. Would have been nice that the sort events were handled after all other events but that's not the case. In other word, don't use (store.setModelComparer) if you expect to sort after a dragNDrop. Use (tree.getStore().sort) when ever you need it.

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..."