Results 1 to 5 of 5

Thread: Store reload() issue

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Store reload() issue

    Hi guys, im trying to use the reload method to pass additional data to a data-generating page, while also maintaining paging for a grid. for e.g.

    ds.load({params:{start:0, limit:20}});
    .........
    .........
    ds.reload({params: {delete: id}});

    basically my aim is to remove an item while also refreshing the contents of the grid (to reflect this change).

    The issue that im experiencing is that the paging properties dont end up getting passed into the data-generating page. Since the reload method is using ApplyIf, the 'param' properties exist in both objects, therefore not applying the paging properties to this additional parameter.

    What would be the best way to go around this without actually editing Ext?

    Thanks,
    Lupco

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    I solved the same problem by adding function reload to the paging toolbar:

    PHP Code:
    paging.reload = function() {
            
    this.ds.load({params: {startthis.cursorlimitthis.pageSize}});

    You can add additional arguments to such a function to make it more versatile.

    Don't know if my solution is best but it works for me.

  3. #3

    Default

    Thanks, what ive formulated is this:

    PHP Code:
    paging.reload = function(params) { 
        var 
    tmp_params Ext.applyIf(params.params||{}, {start:this.cursor,limit:this.pageSize});
        var 
    tmp_options = {paramstmp_params};
        
    this.ds.load(Ext.applyIf(tmp_optionsparams));
    }; 

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Wouldn't setting the Store's baseParams before the standard load call work?

  5. #5

    Default

    Probably, but then i've gotta reset the baseParams back to normal since i only want this data passed once.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •