1. #1
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    0
    loumac is on a distinguished road

      0  

    Default 4.2 beta store.proxy afterRequest with BufferedRenderer grid plugin no data

    4.2 beta store.proxy afterRequest with BufferedRenderer grid plugin no data


    4.2 beta - I am using the new 'Ext.grid.plugin.BufferedRenderer'

    I had a store proxy creating a column header checkbox item to select all items in a grid - I am trying to get the same code up and running with 4.2 beta - but am having problems with the store reporting no data

    store = Ext.create('Ext.data.Store', {
    proxy: {
    afterRequest: function(req, res) {
    Ext.get("selectAll").on('click', function(){
    if($("#selectAll").hasClass('x-grid-checkheader')) {
    store.proxy.setExtraParam('action',actionVar);
    store.each(function(rec){
    rec.set('constantrowselected', true);
    });
    }
    store.load();
    });
    }
    }
    });

    On click of checkbox I get error:
    TypeError: data is undefined


    Is this a consequence of BufferRenderer change and if so can anyone replicate or advise?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    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


    Have you tried updating to the GA release of 4.2.0?
    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 Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    0
    loumac is on a distinguished road

      0  

    Default 4.2 beta store proxy afterRequest

    4.2 beta store proxy afterRequest


    Hi Mitchell,
    I will try the latest and see if that helps
    Thanks

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    0
    loumac is on a distinguished road

      0  

    Default 4.2.0 store.proxy afterRequest

    4.2.0 store.proxy afterRequest


    I changed the code base to 4.2.0 Build date: 2013-03-11 22:33:40 (aed16176e68b5e8aa1433452b12805c0ad913836) - but still have data undefined on store.each

    store = Ext.create('Ext.data.Store', {
    proxy: {
    afterRequest: function(req, res) {
    Ext.get("selectAll").on('click', function(){
    if($("#selectAll").hasClass('x-grid-checkheader')) {
    store.proxy.setExtraParam('action',actionVar);
    store.each(function(rec){
    rec.set('constantrowselected', true);
    });

    }
    store.load();
    });
    }
    }
    });

    any ideas?

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    0
    loumac is on a distinguished road

      0  

    Default accessing buffred store data

    accessing buffred store data


    I used the following in the end:

    for (j=01; j<=grid.store.data.length; j++) {
    var data = grid.store.data.map[j].value;
    for (i=0; i<data.length; i++) {
    data[i].data["constantrowselected"]=true;
    }
    }

    if there is a more efficient way please advise

Thread Participants: 1

Tags for this Thread