1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    6
    Vote Rating
    -1
    tharahan is an unknown quantity at this point

      0  

    Default Unanswered: Loading subset of json into editable combobox in the Grid

    Unanswered: Loading subset of json into editable combobox in the Grid


    Hi

    I am building a grid based on JSON data which is based on the following

    var subAccountStore = new Ext.data.JsonStore({
    autoLoad: true,
    proxy: {
    type:'ajax',
    url : '/opUI/json/subaccount.action?name="ABC"'
    },
    fields: ['accountName', 'accountNumber','accountNumbers', 'quantity']

    });

    and the sample JSON is

    [{"accountName":"'ABC'","accountNumber":"123456","quantity":100,"accountNumbers":['12345A','12345B','12345C']},{"accountName":"'XYZ'","accountNumber":"999999","quantity":100,"accountNumbers":['99999A','99999B','99999C']}]

    Now I am trying to build grid with editable combo box as one of column

    So my code snippet is
    columns: [
    {
    text : 'Account Name',
    width : 60,
    flex : 3,
    sortable : true,
    dataIndex: 'accountName'
    },
    {
    text : 'Account Number',
    flex : 2,
    sortable : false,
    dataIndex: ???,
    editor: new Ext.form.field.ComboBox({
    typeAhead: true,
    triggerAction: 'all',
    selectOnTab: true,
    store: ???,
    lazyRender: true,
    listClass: 'x-combo-list-small'



    })
    },
    {
    text : 'Quantity',
    flex : 2,
    sortable : true,
    dataIndex: 'quantity',
    align : 'right',
    editor: {
    xtype: 'numberfield',
    allowBlank: false,
    minValue: 0,
    maxValue: 100000
    }
    }
    ]


    I am not sure how to make each row shows combobox of it's accountNumbers.

    I would really appreciate if some one can put me in the right direction.

    Thanks
    Tharahan

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    By default the combobox you would need to set a store with it's own data, to get it from the response from the grid, you would need to extend the editing plugin and set the data from the record being edited onto the combobox's store.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    6
    Vote Rating
    -1
    tharahan is an unknown quantity at this point

      0  

    Default


    Thanks the response.

    Can you give me an example for extending the editing plugin?

    Thanks
    Tharahan

Thread Participants: 1

Tags for this Thread