Results 1 to 7 of 7

Thread: Gridcolumn date sorting based on year

  1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    36

    Default Gridcolumn date sorting based on year

    Hi ,

    I am trying to sort date in gridcolumn using sortable: true but the problem is it is sorting based on the month which is not correct for me.All i need is to sort the date based on year.

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Aug 2009
    Posts
    480

    Default

    Well.. it's supposed to sort the date in order according to the year, month day and time... When configuring your fields on the store, have you specified that it's a date column, as well as the date format?

    E.g.

    Code:
     
    fields: [
         { name: 'myDate', type: 'date', dateFormat: 'Y-m-d' }
    ]

  3. #3
    Ext User
    Join Date
    Jul 2010
    Posts
    36

    Default

    Hi, I am trying to add those but iam not clear where i shopuld be adding .I am getting the data through JSON and iam not creating any record.So should i be adding those in the GridColumn fields.Can you tell clearly where i should add?

    Thanks...

  4. #4
    Sencha User
    Join Date
    Aug 2009
    Posts
    480

    Default

    It's in the store definition.

    Code:
     
    var store = new Ext.data.JsonStore({
          fields: [
              ...
          ]
    });

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Quote Originally Posted by Enew View Post
    iam not creating any record.
    Those damn "shortcut" classes leading people astray again!

    There is ALWAYS a Record.

    I've asked them to deprecate and remove the "shortcut" classes, but they won't.

    They KEEP causing problems!

    http://www.sencha.com/forum/showthre...084#post526084

    http://www.sencha.com/forum/showthre...149#post523149

  6. #6
    Sencha User
    Join Date
    Aug 2009
    Posts
    480

    Default

    @Animal, I guess that when the new data package that will be part of Ext 4, developers will be forced to use models and they will deprecate the rest? That would be a good thing to do...

  7. #7
    Ext User
    Join Date
    Jul 2010
    Posts
    36

    Default

    Thanks...It worked

Similar Threads

  1. Date picker default year display
    By ajain in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 24 Sep 2010, 12:34 AM
  2. date - separate to 3 combobox?: day month year
    By phpcoder in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 3 Jul 2009, 5:32 AM
  3. Ext.date parseDate using ISO Year Week and Day
    By Trixor in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 5 Jun 2009, 12:07 PM
  4. date - separate to 3 combobox: day month year
    By noah17 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 20 Apr 2009, 11:29 PM
  5. Grid date sorting by year with m/d/Y format?
    By jfizer in forum Ext 2.x: Help & Discussion
    Replies: 18
    Last Post: 12 Aug 2008, 11:24 PM

Posting Permissions

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