Sencha touch 2 dataview/list Paging

Source: Internet
Author: User

The paging function of sencha touch 2's list must not be described too much. You should know it all. There are also official examples.

However, it is not perfect to directly copy the paging function of the List to dataview. There is a small bug that leads to continuous loading ....

Uncaught typeerror: object [object] has no method 'scrolldockheightrefresh'

Obviously, this function is not available in the dataview component, only in list, but this method is required by the paging plug-in.

Since we need it, we will not care what it will do, so we will add it first. How can I add this method to dataview?

It is easy to add methods in custom components. You only need to add them after config.

After testing, the problem is solved after the scrolldockheightrefresh method is added.

Complete code:

 

Ext. define ('plm. store. product ', {extend: 'ext. data. store', config: {fields: [{Name: 'productname ', type: 'string'}, {Name: 'designerid', type: 'string'}, {Name: 'orderno', type: 'string'}, {Name: 'state', type: 'string'}, {Name: 'wfname', type: 'string '}, {Name: 'inclumgs', type: 'string'}, {Name: 'inclumgb', type: 'string'}, {Name: 'smpimgs ', type: 'string'}, {Name: 'smpimg', ty PE: 'string'}, {Name: 'ida2a2 ', type: 'string'}, {Name: 'pvr', type: 'string'}], proxy: {type: "ajax", URL: "/View/reports/restful/searchproduct", Reader: {type: "JSON", rootproperty: "root", totalproperty: "totalcount" }}, pagesize: 50, autoload: false }}); Ext. define ('plm. view. product ', {extend: 'ext. dataview ', alias: 'product', requires: ['plm. store. product '], config: {ID: 'viewprodu CT ', fullscreen: True, showanimation: {type: 'slide', direction: 'left'}, hideanimation: {type: 'slideout', direction: 'right '}, items: [{xtype: 'toolbar', docked: 'top', ID: 'productviewtb', items: [{xtype: 'twent', UI: 'back', text: 'Back to category list', Action: 'background'}, {xtype: 'spacer'}, {xtype: 'segmentedbutton ', margin: '0 10 0 0', items: [{xtype: 'button ', text: 'sort by payment amount', action: 'Sortbyskc'}, {xtype: 'button ', text: 'sort by design id', Action: 'sortbydesignid'}]}, {xtype: 'segmentedbutton', ID: 'segbtnimagetype ', items: [{xtype: 'button', ID: 'btndesignimg', text: 'Design sketch ', UI: 'Confirm', Action: 'designimg '}, {xtype: 'button ', text: 'sample image', UI: 'Confirm', Action: 'sampleimg'}], store: 'product', emptytext: 'No data found. Check the conditions! ', Padding: 30, plugins: [{xclass: 'ext. plugin. listpaging ', nomorerecordstext:' No more records ', loadmoretext: 'more', autopaging: true}]}, scrolldockheightrefresh: function (){}});

 

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.