Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

335
Vistas
ExtJS pagination is not working and Uncaught ReferenceError: store is not defined

Pagination is not working and my console is showing "Uncaught ReferenceError: store is not defined", I don't know where I am doing wrong.

I'm using eclipse for the development.

Below is my code please guide me I am new in 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}});

});

When I'm trying to use store.load function it throws the error store is not defined.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to assign the created store instance to a variable and then assign this variable to both your grid and paging toolbar:

var myStore = Ext.create('Ext.data.Store', { ...
...
store: myStore, // both in grid an paging toolbar
...

With autoLoad: true as you use you don't need to call load on the store. You don't have to worry about setting start and limit, ExtJS will automatically add these as pageSize is set.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda