Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default [FIXED-443] Store.load callback function is passed wrong argument when called.

    [FIXED-443] Store.load callback function is passed wrong argument when called.


    In 0.97 whenever I do:

    Code:
    store.load({
        callback: function(operation) {
            console.log(operation);
        }
    });
    The operation argument of the callback function contains the actual data as opposed to an instance of Operation class according to the docs.

    Thanks.

  2. #2
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    Thanks for the report.

  3. #3
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Can you give a sample of the Store, Model and Proxy setup you have?
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  4. #4
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Sure.
    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>test</title>
        <link rel="stylesheet" type="text/css" href="/touch/resources/css/ext-touch.css" />
        <script type="text/javascript" src="/touch/ext-touch-debug.js"></script>
        <script type="text/javascript">
            Ext.regModel('Contact', {
                fields: ['firstName', 'lastName']
            });
            
            Ext.setup({
                onReady: function() {
                    var contactStore = new Ext.data.Store({
                        model: 'Contact',
                        proxy: {
                            type: 'ajax',
                            url: 'data.json'
                        }
                    });
                    
                    new Ext.Panel({
                        fullscreen: true,
                        dockedItems: {
                            dock: 'top',
                            xtype: 'toolbar',
                            title: 'Contacts'
                        },
                        layout: 'fit',
                        items: [{
                            xtype: 'list',
                            store: contactStore,
                            tpl: '<tpl for="."><div class="contact">{firstName} {lastName}</div></tpl>',
                            itemSelector: 'div.contact',
                            singleSelect: true
                        }]
                    });
                    
                    contactStore.load({
                        callback: function(operation) {
                            console.log(operation); // operation contains the actual data, not an instance of Operation class
                        }
                    });
                }
            });
        </script>
    </head>
    <body>
    </body>
    </html>
    data.json
    Code:
    [
        {"firstName": "Julio", "lastName": "Benesh"},
        {"firstName": "Julio", "lastName": "Minich"},
        {"firstName": "Tania", "lastName": "Ricco"},
        {"firstName": "Odessa", "lastName": "Steuck"},
        {"firstName": "Nelson", "lastName": "Raber"},
        ....
    ]

  5. #5
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Thanks, I got this reproduced locally. I'm marking this one as a documentation bug as I think the arguments given to the function are useful; instead of function(operation) the signature looks like function(records, operation, success). I've updated the docs to reflect this and added this shortcut:

    Code:
    store.load(function(records, operation, success) {
        console.log('loaded the records', records);
    });
    This will be present in the next release.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  6. #6
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Is it in 0.97? Because I just tried it and it didn't work. Besides, what about passing other stuff to the load method? It used to accept an object as a parameter, where a developer could specify not only a callback function, but also scope, params, paging specific options.

  7. #7
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Oh, I'm sorry, I didn't read your reply carefully enough. Got it.

  8. #8
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Perhaps I wasn't clear. In 0.97 you already get those three arguments - records, operation, success.

    In 0.98 (not out yet), you can still pass in other options, but as a convenience you can just pass in a function if the only option you want is a callback. So the following will be equivalent:

    Code:
    store.load({
        callback: function(records, operation, success) {
          //...
        }
    });
    and:

    Code:
    store.load(function(records, operation, success) {
      //...
    });
    When 0.98 comes out you will be able to use that second format. Until then stick with the former.
    Last edited by edspencer; 21 Oct 2010 at 12:31 PM. Reason: fixed example
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  9. #9
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Quote Originally Posted by elishnevsky View Post
    Oh, I'm sorry, I didn't read your reply carefully enough. Got it.
    Heh ok np
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  10. #10
    Sencha - Support Team keckeroo's Avatar
    Join Date
    Mar 2008
    Location
    Winnipeg, Canada
    Posts
    298
    Vote Rating
    9
    keckeroo will become famous soon enough

      0  

    Default


    I'm finding SUCCESS is always coming back returned as false. I've tracked this back to the Observable where success is initially defined as undefined and where wasSuccessful evaluates the value of this.success.

    My records are read properly and a success property is found and correctly evaluated as 'true'. The value, however, is not set back in the observable and hence when the store is loaded the success value is always undefined.

    Kevin

Similar Threads

  1. livegrid.store callback doesn't work in load function.
    By pclovec in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 26 Mar 2010, 4:42 PM
  2. Replies: 6
    Last Post: 19 Jan 2010, 1:56 PM
  3. Ext.Direct callback function not called when 'xhr' excepion is fired
    By pmarko in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 25 May 2009, 7:42 AM
  4. pass additional argument to a callback function
    By drrs in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 19 Feb 2009, 10:35 AM

Thread Participants: 3

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