1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
    Answers
    1
    pret is on a distinguished road

      0  

    Default Unanswered: How to access the Ext.data.Operation object on the load event of a TreeStore?

    Unanswered: How to access the Ext.data.Operation object on the load event of a TreeStore?


    Hi guys,

    I'm implementing an event handler for the load operation of a TreeStore, but I need the Ext.data.Operation object to access to additional data I'm sending on the response, but I see that this event on a TreeStore doesn't receive an Ext.data.Operation object, which is different from the behaviour of a common Store.

    How could I access the Ext.data.Operation from a "load" event handler of a TreeStore?


    Thanks!

  2. #2
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
    Answers
    1
    pret is on a distinguished road

      0  

    Default


    For now I'm doing it in an ugly way. I've added an event handler for the "beforeload" event, grab the operation from there and use it then on the "load" event handler. Code:

    Code:
    this.store = Ext.create('Ext.data.TreeStore', {
        // ...Other options
        listeners:           {
            beforeload:        function(store, operation, eventOptions) { 
                 this.operation = operation; 
            },
            load:              function(store, node, records, success, eventOptions) {
                // Now I have the operation..
                var operation = this.operation;
            }
        }
    });
    If anyone knows a better way to do this, I'll appreciate to hear it.


    Thanks!