Results 1 to 2 of 2

Thread: Paging toolbar: call store.load() instead of the auto firing of paging store.load()

  1. #1
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Answers
    1

    Default Paging toolbar: call store.load() instead of the auto firing of paging store.load()

    I'm trying to add a custom store.load() before the paging load event is fired. I can put the logic in 'beforechange' and return false, but then the page information doesn't get updated. This actually used to work in 4.0.7. In 4.1 RC3 this doesn't seem to work anymore.

    I can't get this to work with the 'beforeload' listener of the store in MVC as logic is done in the controller. Anyway to just suppress the paging 'load' event from happening and having the pagingtoolbar update its page number and other information?

    Also, the parameters and content-type are JSON data so the param structure must be in JSON format which makes things way more difficult.

    Code:
    Ext.define('RH.store.mrln.PagedThumbnails', {
        extend: 'Ext.data.Store',
        model: 'RH.model.mrln.Thumbnails',
        remoteSort: false,
        pageSize: 25,
        proxy: {
            actionMethods: { read: 'POST'},
            headers: {'Content-Type': 'application/json; charset=utf-8' },
            type: 'ajax',
            noCache: false,
            url: 'data.json',
            reader: {
                type: 'json',
                root: 'contents',
                totalProperty: 'count',
                getData: function(data){
                    return Ext.isArray(data) ? data[0] : data;
                }
            }
        }
    });
    Code:
                'thumbnails > pagingtoolbar': {
                    beforechange: function(ptb,page,opts) {
                        // this does the store.load() event with some logic.
                        this.application.fireEvent('getcontents',resourceView,nodeId,page,ptb.store.pageSize);
                        ptb.page = page; // obviously doesn't work
                        return false; // works but doesn't update the page number
                    }
                }
    store.load() JSON parameters
    Code:
    {"user":"tad","agent":"Web_mrln","system":"mrln","method":"getPagedContents","types":["rh.pb.UIntPB","rh.pb.BoolPB","rh.pb.UIntPB","rh.pb.UIntPB"],"params":[{"arg":["{value: 189531}","{value: true}","{value: 26}","{value: 25}"]}]}

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Answers
    1

    Default

    I can include operation.params = ... but I need to fire an application event on callback through MVC and that would kind of defeat the purpose if I wanted to use this store in a different app in a different way.

Posting Permissions

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