1. #1
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    10
    Vote Rating
    0
    udayogra is on a distinguished road

      0  

    Default Unanswered: ColumnModel of Grid

    Unanswered: ColumnModel of Grid


    1. In previous versions grid used to have 'columnmodel' which does not exist now.
    That model used to have these methods colModel.getCellEditor,colModel.getDataIndex(i)


    What are the alternative methods now? For dataindex I used grid.columns[i].dataIndex, is it the right way?


    2. We also used to use Records a lot like this :


    Code:
      grid.getStore().add(new Ext.data.Record(insertData))
    where insertData would be key value pairs of column name and corresponding values.
    But this doesnt work now. Do I need to use 'Model instead? Is the syntax same?'

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,084
    Answers
    112
    Vote Rating
    95
    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

      0  

    Default


    Not sure what you want to get in your first question. may be the getPlugin() method of the grid is what you are looking for? You can access the columns array using grid.columns.

    For (2), you have to add model instances to your store. you can find an example in the API Docs:

    Code:
    store.add({some: 'data'}, {some: 'other data'});
    So yes, its a key:value pair (you can add more than one). If you have your data in an array, you can use store.loadData(dataArray);

    I would recommend taking a look at the API Docs. that will surely answer a lot of questions.

Thread Participants: 1

Tags for this Thread