javascript - ExtJs 5.1 paging tool bar in grid panel -
using extjs 5.1, when load grid panel showing correct paging number in paging tool. during page load time show page 1 of 5. previous , next buttons disabled.
#
var store = new ext.data.store({ autoload: {params:{start: 0, limit: 5}}, pagesize: 5, remotesort: true, model: 'tenantdetails', proxy: { type: 'ajax', enablepaging : true, url: 'http://localhost:8080/restcountries-dev/rest/page/v0.5/tenant', reader: new ext.data.jsonreader({ type: 'json' , totalproperty:15, rootproperty:'tenant' }) }, listeners:{ load:function(store){ ext.getcmp('tenant_detail_grid').getselectionmodel().select(0, true); } } });
#
and paging toolbar defined below.
bbar:
ext.create('ext.pagingtoolbar', { store: store, displayinfo: true, displaymsg: '{0} - {1} of {2}', emptymsg: "no topics display" })
#
don't know i'm missing.thanks
hi code looks correct. here's working example of paging.
initcomponent: function () { var me = this; me.store = ext.create('desktop.children.store.childrenstore'); me.columns = [ { text : 'nachname', dataindex: 'lastname', flex: 1 }, { text : 'vorname', dataindex: 'firstname', flex: 1 }, { text : 'gruppe', //name: 'group_id', dataindex: 'groupname', flex: 1 }, { text : 'faktor', //name: 'group_id', dataindex: 'factorname', flex: 1 }, { xtype: 'datecolumn', text : 'geburtsdatum', dataindex: 'birthdate', format: 'd.m.y', flex: 1 }, { text : 'status', //name: 'group_id', dataindex: 'isactive', flex: 1 }, { xtype: 'actioncolumn', width: 60, menudisabled: true, items: this.loadcontrolbar() } ]; me.plugins = [{ ptype:'saki-gridsearch' ,searchtext: 'suchen' ,autotiptext: 'mindestens zwei zeichen' ,selectalltext: 'selektiere alle' }]; me.bbar = me.paging = ext.create('ext.toolbar.paging', { store:me.store ,displayinfo:true }); me.tbar = [ { xtype: 'button', id:'child_btn_add', text:'kind hinzufügen', tooltip:'neues kind hinzufügen', iconcls:'add', hidden: (checkpermission('desktop.children.view.mainwindow') != "write"), handler:function(view, e){ this.fireevent('addchildren', view, e); } }, { xtype: 'button', id: 'btnchildexport', text: 'liste exportieren', tooltip: 'spezifische liste exportieren', iconcls: 'exportlist', handler: function(view, e){ this.fireevent('exportlist', view, e); } } ]; me.callparent(); },
store:
ext.define('desktop.children.store.childrenstore', { extend: 'ext.data.store', id: 'childrenstore', alias: 'widget.childrenstore', requires: [ 'desktop.children.model.childrenmodel', 'ext.data.proxy.memory', 'ext.data.reader.array' ], model: 'desktop.children.model.childrenmodel', //autoload:true, pagesize: 10, proxy: { type:'ajax', enablepaging: true, url:'resources/php/json.php', headers: { 'content-type': 'application/json' }, extraparams:{ data : json.stringify({ module : "children", action : "load", jsonobject : null}), start: 0, limit: 10, }, reader:{ type:'json', rootproperty: 'anfang' } }, sorters: [{ property : 'lastname', direction:'asc' }], });
Comments
Post a Comment