Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8793117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:04:55+00:00 2026-06-13T23:04:55+00:00

I have a jsonstore. var speedDialStore = new Ext.data.JsonStore({ pageSize: 4, proxy : {

  • 0

I have a jsonstore.

var speedDialStore = new Ext.data.JsonStore({
                pageSize: 4,
                proxy   : {
                    type: 'ajax',
                    url: 'speedDialListByHospitalID.html',
                    actionMethods: {
                        create: 'POST', read: 'POST', update: 'POST', destroy: 'POST'
                    },
                    reader: {
                        type: 'json',
                        root: 'results',
                        totalProperty: 'total',
                    }
                },
                fields      : [{name:"id"},{name:"code"},{name:"name"},{name:"description"},{name:"hospitalID"},{name: "buildingID"},{name: "floorID"},{name:"alarmID"},{name:"notificationFrequency"},{name:"maxCount"},{name:"start"}],
                listeners: {
                  load : function (store, records, success, operation, options) {
                    if(records != null){
                        store.loadData(records.slice(records[0].get('start'),records[0].get('start')+4));
                    }
                  } 
                }

            });

And a grid that uses this store.

My problem is when grid is sorted i need to sort all the store and just show first 4 element for the first page and second 4 element for the second page so on..

listeners:{
                        'sortchange': function(ct, column, direction, eOpts ){
                                Ext.getCmp('speedDialPaging').moveFirst();
                                speedDialStore.sort(column.dataIndex, direction);
                        }
                    },

after the slice method works, grid still shows the unsorted 4 elements. But if i add alert message or breakpoint at slice method i see that the store is sorted properly. Therefore (i think) i need to modify slice method or find any other way to solve this problem.. Server is sending all the data. We have to solve this problem here not server side.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:04:56+00:00Added an answer on June 13, 2026 at 11:04 pm

    change store listener like this,

    listeners: {
                      load : function (store, records, success, operation, options) {
                        if(records != null && records.length > 0){
                            function compare(a,b) {
                              if (a.get(sortIndex) < b.get(sortIndex))
                                 return -1;
                              if (a.get(sortIndex) > b.get(sortIndex))
                                return 1;
                              return 0;
                            }
                            records.sort(compare);
                            if(sortDirection == "DESC"){
                                records.reverse();
                            }
                            store.loadData(records.slice(records[0].get('start'),records[0].get('start')+4));
                        }
                      } 
                    }
    

    and sortchange listener like this,

     sortIndex = column.dataIndex;
     sortDirection = direction;
    

    it works!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code - var options = new Ext.data.JsonStore({ model: 'options_model', data:
I have a JsonStore: var store = new Ext.data.JsonStore({ root: 'Data.items', remoteSort: false, fields:
My JsonStore is so defined: var data_json = new Ext.data.JsonStore({ url: '/Game/json_index', autoLoad: true,
I have a JsonStore configured like so: var store = new Ext.data.JsonStore({ restful: true,
I have a store: var store = new Ext.data.store({ autoLoad: true, autoSync: true, model:
I have a GridPanel in EXTJS4 with JSONstore. Like this: var storeGridSpe = Ext.create('Ext.data.JsonStore',{
Iam design ExtJs Combo and bind from database var AddEditPeopleStoreCompanyLocation = new Ext.data.JsonStore ({
I am new to ext Js. I have a ajax call. I could see
This is my code: Ext.define('gridOptionsModel', { extend: 'Ext.data.Model' }); var gridOptionsStore = Ext.create('Ext.data.JsonStore', {
I have the following code. I'd like to make the proxy's type and url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.