1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    117
    Vote Rating
    1
    RobWilson is on a distinguished road

      0  

    Exclamation Design combo with ArrayStore - (cannot read property autoCreate - lack of 'field'?)

    Design combo with ArrayStore - (cannot read property autoCreate - lack of 'field'?)


    When I create a new ArrayStore in the designer, I set the data to

    Code:
    [
    [1,"T+1"],
    [2,"T+2"],
    [3,"T+3"],
    [4,"T+4"],
    [5,"T+5"],
    [6,"T+6"],
    [7,"T+7"],
    [8,"T+8"],
    [9,"T+9"],
    [10,"T+10"]
    ]
    I set the class to 'SettlementStore' and the store id to 'SettlementStoreId' and the idIndex to 1 (presumably this should show T+1..T+10 in the combo).

    When I associate the combo box to use the SettlementStoreId, I get the error

    Uncaught TypeError: Cannot read property 'autoCreated' of undefined

    All I can think of, is that in examples where it's coded by hand, you specify the 'fields', but within the designer there is no option to do that.

    What could I be missing, or is this a limitation in the designer? - What would a workaround be, i.e. creating the store in code and then how to assign to the generated ui code.

    Many thanks,
    Rob.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    1. You probably want idIndex:0 (I assume the identity field is the number and not the text).

    2. Cannot read property 'autoCreate' of undefined is an error from the combobox and not of the store. How exactly are you setting up this combobox?

  3. #3
    Sencha User
    Join Date
    Sep 2008
    Posts
    117
    Vote Rating
    1
    RobWilson is on a distinguished road

      0  

    Default


    Hi Condor,

    Thank you for your quick reply.

    The combo is created mostly with defaults, but I've entered the class name, store ID and associated it to the array data store.

    The hiearchy is

    viewport -> panel (card layout) -> panel -> form -> fieldset -> combo

    Is this enough to help, or should I try to re-create in a small sample project?

    Cheers,
    Rob.

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Did you set the 'transform' config option?

  5. #5
    Sencha User
    Join Date
    Sep 2008
    Posts
    117
    Vote Rating
    1
    RobWilson is on a distinguished road

      0  

    Default


    Nope - I feel like I'm missing something? ;-) Are you saying I need to do a transform of some sort on the combo?

    What's the deal with the missing 'fields' parameter?

    Cheers,
    Rob.

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    An ArrayStore with local data needs to be configured with 'fields' and 'data', e.g.
    Code:
    fields: ['value', 'text'],
    idIndex: 0,
    data: [[1, 'One'], [2, 'Two'], [3, 'Three']]

  7. #7
    Sencha User
    Join Date
    Sep 2008
    Posts
    117
    Vote Rating
    1
    RobWilson is on a distinguished road

      0  

    Default


    That was my original point - how do you set the fields in the designer? I can't see the attributes in the ArrayStore.

    If I type 'field' in the property inspector, to filter the attributes displayed, it only shows sortField ... so How can I specify the fields attribute through designer, or a workaround for an alternative?

    What was the reference to transforming - was that related to your fields reply?

    Thanks,
    Rob.

  8. #8
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    I don't use the Designer, so I had to fire it up for this question...

    Right click on the store and select Add fields.

  9. #9
    Sencha User
    Join Date
    Sep 2008
    Posts
    117
    Vote Rating
    1
    RobWilson is on a distinguished road

      0  

    Default


    Ah! A context menu, I didn't even know there were any - it's not obvious

    Thank you!

  10. #10
    Sencha User
    Join Date
    Sep 2008
    Posts
    117
    Vote Rating
    1
    RobWilson is on a distinguished road

      0  

    Default


    My problem turned out to be that I forgot to add the new <JavaScript> import in my HTML file (doh!), but you tips about adding fields were still required.

    Thanks Codor,
    Rob.

Similar Threads

  1. [CLOSED] combo autoSelect doesn't work with ArrayStore
    By PaloAltoNetworks in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 14 Dec 2010, 2:16 AM
  2. Combo with arraystore: this.proxy is undefined error
    By Tumac in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 23 Nov 2010, 12:35 PM
  3. ArrayStore/SimpleStore Combo before onReady error?
    By SlashEMc2k in forum Ext.air for Adobe AIR
    Replies: 3
    Last Post: 4 Aug 2010, 6:38 AM
  4. Replies: 4
    Last Post: 12 Mar 2010, 3:13 AM
  5. Some text after form field (autoCreate: true)
    By 72 in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 4 May 2007, 6:04 AM

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar