Results 1 to 2 of 2

Thread: Sorting is not working

  1. #1

    Default Sorting is not working

    Hi,
    I am using below code but i am not able to sort the columns
    I got error as "this.fields is undefined", Please help me regarding this issue.

    var store = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({
    nocache : false,
    url : '../plugins/gmitc/extjs/unsubscribes.php?task=view',
    reader : new Ext.data.JsonReader({
    root : 'results',
    totalProperty : 'total',

    fields : [
    {name: 'created', type: 'date', dateFormat: 'Y-m-d h:i', sortable: true},
    {name: 'email', sortable: true, type: 'string'}
    ]}),
    }),
    remoteSort: false
    });

    var grid = new Ext.grid.GridPanel({
    handler : email,
    loadMask : { msg: Config.load_mask, store: store },
    viewConfig : { emptyText: 'Empty' },
    store : store,

    cm: new Ext.grid.ColumnModel([{ header : 'Email',
    id : 'email',
    name : 'email',
    width : 120,
    sortable : true,
    dataIndex : 'email',
    renderer : email},
    { header : 'Created Date',
    width : 90,
    sortable : true,
    dataIndex : 'created',
    renderer : Ext.util.Format.dateRenderer('Y-m-d H:i')},itemDeleter ])

  2. #2
    Sencha Premium Member findajit's Avatar
    Join Date
    Mar 2009
    Location
    Hyderabad, India
    Posts
    67

    Default

    You shall be setting the fields property on the store rather than on the JsonReader.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •