1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    16
    Vote Rating
    0
    TWEESTY is on a distinguished road

      0  

    Default Answered: Put a date in my store

    Answered: Put a date in my store


    Hello all!

    I have a problem I can't add a date into my store.

    Here my store :

    Code:
    Ext.define('GDStock.store.EvolutionPrixAchatProduit',{
        extend: 'Ext.data.Store',
    
    
        fields: [
            {name: 'date', type: 'date', format: 'Y-m-d H:i:s'},
            {name: 'prix', type: 'float'},
        ],
    });
    I want to put a record like this :

    Code:
    store.add({date : '2000-10-02 10:10:11'},{prix : 2});
    I tried too :

    Code:
    store.add({date : new Date(2000,10,02,10,10,11)},{prix : 2});
    When I look my record, I see "null"

    console.log(store.last().get('date'));

    Thank you for your help!

  2. One record is encapsulated in braces "{}" and not individual fields. try this:

    Code:
    store.add({date : '2000-10-02 10:10:11', prix : 2});

  3. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,099
    Answers
    113
    Vote Rating
    96
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      1  

    Default


    One record is encapsulated in braces "{}" and not individual fields. try this:

    Code:
    store.add({date : '2000-10-02 10:10:11', prix : 2});

  4. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    16
    Vote Rating
    0
    TWEESTY is on a distinguished road

      0  

    Default


    Thank youuuuuuuuuuuu!

Thread Participants: 1