Results 1 to 3 of 3

Thread: CollectionGroup rely on Javascript Date.toString to print an unique string

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Default CollectionGroup rely on Javascript Date.toString to print an unique string

    CollectionGroup when the id property is date type, it rely on toString to be unique and be used like index. When the toString method is overrided (for some reason) and a format like 'Y-m-d' is used instead to print the date, then all the objects of same day print the same string. This produce a bad behaviour of Ext.form.field.Time component that only allow select the first record because the map used to index all the times have only one key and all records inside.
    See: https://fiddle.sencha.com/#view/editor&fiddle/27sk
    In the fiddle i put a possible solution that work fine.
    I understand that the best solution is not to override anything in Date class, but it can happen.

  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    You could say the same for numbers or any other type. I don't really see how this is a bug with the framework.

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2013
    Posts
    113

    Default

    Quote Originally Posted by enbeltran87 View Post
    I understand that the best solution is not to override anything in Date class, but it can happen.
    I agree with evant. Overriding the native APIs is considered bad practice and should not be done specifically because it causes problems like this. Instead, you should create a complex type like Ext.Date that can format a date to a string.

Similar Threads

  1. Unique localstorage based on string in URL
    By MattPedro in forum Sencha Touch 2.x: Discussion
    Replies: 2
    Last Post: 26 Jan 2015, 7:14 AM
  2. Ext.Date.toString and timezones
    By jonasby in forum Ext: Q&A
    Replies: 3
    Last Post: 27 Nov 2012, 6:45 AM
  3. how to print javascript variable in xtemplate
    By thiszparveen in forum Ext: Q&A
    Replies: 1
    Last Post: 9 Oct 2012, 3:14 AM
  4. Print a json string to multiple data grids
    By spextjs in forum Sencha Ext JS Q&A
    Replies: 3
    Last Post: 5 Jun 2008, 11:08 AM
  5. JSON String and print values
    By spextjs in forum Sencha Ext JS Q&A
    Replies: 5
    Last Post: 5 Jun 2008, 6:44 AM

Tags for this Thread

Posting Permissions

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