1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    72
    Vote Rating
    3
    TDeBailleul is on a distinguished road

      0  

    Default Store callback function on load + Operation

    Store callback function on load + Operation


    Hi everyone,

    I can't find a way to specify an Ext.data.Operation and a callback function in the load method of a store.

    I presently have this :

    Code:
    app.stores.actualites.load({
        new Ext.data.Operation( 
            start:0,
            limit:app.stores.actualites.getCount(),
        })
    );
    How should I add the callback function ?

    Thank you

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You don't pass an instance of Operation, you pass a config...

    Code:
    store.load({
        params : {},
        success : function() {},
        failure : function() {},
        callback : function() {}
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    72
    Vote Rating
    3
    TDeBailleul is on a distinguished road

      0  

    Default


    Thanks for your answer.
    Here's what I'm doing now :

    Code:
    refreshActu: function(user, newsPerLoad) {
        app.loadmask.show();
        app.stores.actualites.load({
            params : {
                start:0,
                limit:newsPerLoad
            },
            callback : function(records, operation, success) {
                app.loadmask.hide();
                console.log(newsPerLoad+" / "+app.stores.actualites.getCount()); <--- 1 / 21
            }
        });
    },
    The callback function works but params don't..
    Is there anything I'm doing wrong here ?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This sent the params:

    Code:
    var store = new Ext.data.Store({
        fields : ['company'],
        proxy : {
            type   : 'ajax',
            url    : 'data.php',
            reader : {
                type : 'json',
                root : 'data'
            }
        }
    });
    
    store.load({
        params : {
            foo : 'bar'
        },
        callback : function() {
            console.log('returned');
        }
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Oct 2014
    Posts
    2
    Vote Rating
    0
    grajkamal9 is on a distinguished road

      0  

    Default Answer please

    Answer please


    How to fetch the value of the field company in the above Code from variable store


    thank you,
    Beginner

  6. #6
    Sencha User
    Join Date
    Oct 2014
    Posts
    2
    Vote Rating
    0
    grajkamal9 is on a distinguished road

      0  

    Default


    any one answer please its urgent . How to fetch the value of the field company in the above Code from variable store