About EXTJS4 grid with query parameter paging (baseparams-->extraparams)

Source: Internet
Author: User

(Many articles in the park, the reputation of its Yue: ExtJS gridpanel+ query conditions + paging. However, after adding the query conditions, click on the next page, the query condition is invalid, please do your own testing and show off

Don't mislead me about this new person. )

EXTJS6 released, EXTJS4 is not new, the first thing to say is in 5. In X and 6.X, there is no change in the properties or methods of the problem. I'm not sure.

ExtJs4 in the proxy, and there is no baseparams this attribute, ExtJs4 into what?

Check a lot of people in the Chinese blog did not find the results, the last to see a section of English:

You need to use the ' Extraparams ' proxy property in place of the Baseparams one from Ext 3. An equivalent jsonstore in ExtJS 4.

The answer is very clear, use extraparams to replace.

Problem Description:

For example, the original load data is 100 pages, after the query does show 7 pages, click on the next page has become the second page of 100 pages. I think this must be a very common problem.

Workaround:

The Proxy Plus property for your store

var mystore = ext.create (' Ext.data.Store ' , { fields: ["Roleid", "RoleName", "Createtime", "Modifytime", "Modifyadmin", "Delflag"],//"Createadmin"Pagesize:15,//page Capacity Bar data        //whether to sort on the server (true if the client cannot sort)Remotesort:false, Remotefilter:true, proxy: { type:' Ajax ', URL:"/adminarea/adminrole/getrolelistjson",//            //extraparams: {            //Showdel: $ (' #hiddenDelflag '). Val ()            //},Reader: {//here the reader for the data storage organization, the following configuration is for the data in JSON format, for example: [{"Total": [{] "a": "3", "B": "4"} ]Type: ' JSON ',//The return data type is in JSON formatRoot: ' Rows ',//DataTotalproperty: ' Total '//total number of data bars}, extraparams: {showdel: ' true ' } }, sorters: [{//The sort field. Property: ' Roleid ',            //sort type, ASC by default            //direction: ' desc '}], AutoLoad:true  //Load Data instantly});

When you need to query or filter the conditions for----do not display the information in the Recycle Bin----is to

Will Showdel:false, refresh the table, page, still do not display information in the Recycle Bin.

How to retain this parameter has always existed, that is, the above method.

If you see other articles telling you to use Baseparams, replace them with Extraparams in EXT4.

Extended:

So how to dynamically get Showdel this property, and modify it. The following code will give you an answer,

var proxy =  mystore.getproxy ();         = False;  Get and modify        mystore.load ();

This way, unless you change the parameters again, no matter how you turn the page, the Showdel is false;

About EXTJS4 grid with query parameter paging (baseparams-->extraparams)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.