Results 1 to 6 of 6

Thread: change data structure before send combo

  1. #1
    Sencha User
    Join Date
    Oct 2007
    Posts
    89

    Default change data structure before send combo

    Hi,

    I have a server which return these datas (I can't change this return):

    Code:
    {"datas":[["1"],["2"],["3"],....],"success":1}

    I have a combobox with remote=true

    Code:
    ....
    var store =  new Ext.data.JsonStore( {
            root: "datas",
            proxy: myProxy,
            fields:???
            ]
    
        } );
    
    
        var combo = Ext.create( 'Ext.form.field.ComboBox', {
          labelField: "sdf",
          displayField: 'myValue',
          valueField: 'myValue',
          labelWidth: 100,
          minChars : 1,
          store: store,
          queryParam: 'myParam',
          queryMode: 'remote'
    
    
        } );

    is is possible to change the data in jsonStore with
    Code:
    {"datas":[{myValue:"1"},....],"success":1}
    before the data send to my combo

    Do you have a another solution ?

    Thanks you very much

  2. #2
    Sencha User
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522

    Default

    Ultimately, you're just trying to get the data into the store so that it's usable, correct?

    If so, you should try an ArrayStore (http://docs.sencha.com/extjs/4.2.1/#...ata.ArrayStore) instead of a JsonStore since the ArrayStore is out-of-the-box configured to handle the type of data that your server is currently returning.

  3. #3
    Sencha User
    Join Date
    Oct 2007
    Posts
    89

    Default

    cool thanks you very much, it's the solution

  4. #4
    Sencha User
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522

    Default

    Quote Originally Posted by lenoil View Post
    cool thanks you very much, it's the solution
    Glad it worked! Can you mark this thread as answered?

  5. #5
    Sencha User
    Join Date
    Oct 2007
    Posts
    89

    Default

    How ? I don't see a button for that ?

  6. #6
    Sencha User
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522

    Default

    Lol, nevermind, wrong forum

Posting Permissions

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