0

I have multiple store on my page to load data in extjs grid. I am using a js function to load these store. Based on the search button click event I attach the respective store to the grid. Its working fine. In the load function I have lots of params that I need to send to the backend to fetch the results and show in the grid. Now with pagination in place. Is there anyway that I can add that js function call inside the paging so I can pass those params. Because right now if I click next button in paging nothing is getting returned. since the required parameters are missing to fetch the results. I tried all the given sample on internet but nothing is working.

It would be great if somebody can actually post an example on paging passing parameters or calling js function on next button event.

Any help will be really appreciated. Thank you.

below is the load store function that I want to call on my next event on pagination.

function loadStore(prodId, productsName, doctype, criteria, filename, titlename) {
    store.removeAll();
    store.load({
        params: {
            // specify params for the first page load if using paging
            start: 0,
            limit: g_perPage,
            ajax: "true",
            productId: prodId,
            ProductsNameArr: productsName,
            assetsname: doctype,
            criterianame: criteria,
            newfilename: filename,
            newtitlename: titlename
        }
    });
}
Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
Renuka
  • 1
  • 3

3 Answers3

0

http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-property-baseParams

  • that is not working for me. Can you please add an example on how I can do that in my paging code. Thank you – Renuka Jun 29 '12 at 23:04
0

As Nigel said above the beforeload event is what you are after, see below for an example:

store.on('beforeload',function(store,opts) {
   store.baseParams = { param1: 'foo', param2: 'bar', ... }
});
gunnx
  • 1,229
  • 7
  • 16
0

baseParams does not seem particularly useful because it sends static values, not the latest search criteria. Getting the dynamic search criteria is tricky too because the grid (i.e. the form fields) may not exist yet.

The Ext JS devs seem to have consistently mistaken docstring fragments for real documentation making for quite a hellish learning curve with their product. A few real examples here would go a long way.

Everett
  • 8,746
  • 5
  • 35
  • 49