La paginación no funciona y mi consola muestra "Error de referencia no detectado: la tienda no está definida", no sé dónde estoy haciendo mal.
Estoy usando eclipse para el desarrollo.
A continuación se muestra mi código, por favor guíeme. Soy nuevo en ExtJS.
js_ext.js
Ext.onReady(function() { var itemsPerPage = 6; Ext.create('Ext.data.Store', { storeId: 'mydata', fields:[ 'title', 'desc', 'year', 'lang', 'name', 'rate', 'special'], pageSize: itemsPerPage, autoLoad: true, proxy:{ type:'ajax', url: 'mystoredata.js', enablePaging: true, reader: { type: 'json', rootProperty: 'items' } }, }); Ext.create('Ext.grid.Panel', { title: 'Movie Grid', store: 'mydata', columns: [ { text: 'Title', dataIndex: 'title', flex: .2 }, { text: 'Description', dataIndex: 'desc', flex: 1 }, { text: 'Release Year', dataIndex: 'year' }, { text: 'Language', dataIndex: 'lang' }, { text: 'Director', dataIndex: 'name' }, { text: 'Rating', dataIndex: 'rate' }, { text: 'Special Features', dataIndex: 'special', flex: .14} ], height: 330, fullscreen: true, renderTo: 'mygrid', selModel: { selType: 'checkboxmodel' }, tbar: { xtype: 'pagingtoolbar', displayInfo: true, store: 'mydata', pageSize: itemsPerPage } }); store.load({params:{start:0, limit:6}}); }); Cuando estoy tratando de usar la función store.load , arroja el error store is not defined .
Debe asignar la instancia de la tienda creada a una variable y luego asignar esta variable tanto a su cuadrícula como a su barra de herramientas de paginación:
var myStore = Ext.create('Ext.data.Store', { ... ... store: myStore, // both in grid an paging toolbar ... Con autoLoad: true a medida que lo usa, no necesita llamar a la load en la tienda. No tiene que preocuparse por configurar start y limit , ExtJS los agregará automáticamente a medida que se configure pageSize .