Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

330
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!