[CLOSED] Create a new record for store by JavaScript?

  1. #1

    [CLOSED] Create a new record for store by JavaScript?

    Hi:

    I have a store which is loading the data from the database. On the page, I want to use JavaScript to insert a new record into the store. I knew I can use the store.insertRecord method to do it. The question is. How can I create a new record with the same structure of record from the store?

    Thank you.
    Last edited by Daniil; Apr 13, 2011 at 12:47 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please note that Store's .insertRecord() expects record's values, not a record instance.
    store.insertRecord(0, { field1: "1", field2: "2"})
    Internally, this method creates a record's instance to insert to the store, to create it uses .recordType().
    http://dev.sencha.com/deploy/dev/doc...ber=recordType
  3. #3
    I see, that's solve my problem, thank you mate.
  4. #4
    post a new thread in wrong place

Similar Threads

  1. create a record
    By Willisney in forum 2.x Help
    Replies: 0
    Last Post: May 05, 2012, 4:01 AM
  2. Replies: 1
    Last Post: Dec 22, 2011, 6:17 AM
  3. Replies: 16
    Last Post: May 26, 2011, 10:23 PM
  4. event of record-create on gridpanel
    By yossi in forum 1.x Help
    Replies: 0
    Last Post: Oct 13, 2009, 2:54 PM
  5. [CLOSED] Adding a new Store Record - Not a Record object
    By Steve in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 15, 2009, 7:40 AM

Posting Permissions