Results 1 to 3 of 3

Thread: Grid Panel with combobox in each cell of one column

  1. #1
    Sencha User
    Join Date
    Jul 2015
    Posts
    10
    Vote Rating
    0
      0  

    Default Answered: Grid Panel with combobox in each cell of one column

    Hi all!

    Currently I have a grid with an ArrayStore that I load with JSON items. Each record in the grid is a Message and each Message has an array of "To" objects. My goal is to be able to have each cell in the To column to be a combobox so that when the user clicks the To value of a Message, they can see all the To objects in that array.

    Is this possible? A few of the threads I've seen describe a situation where they want to set the editor of a column to be a combobox with a static list of values. These examples do not really apply to my situation.


    Just to be clear, the grid has an ArrayStore and the To field is of type 'auto'. Here is the column definition I've tried so far and it just displays [object Object], [object Object], .... inside of the cell:

    Code:
    {
    text: 'To', flex: 1, dataIndex: 'tos', editor: {
    xtype: 'combobox', store: new Ext.data.Store({ fields: [{ name: 'nodeId', type: 'int' }, { name: 'nodeName', type: 'string'
    }]
    }), queryMode: 'local', valueField: 'nodeId', displayField: 'nodeName' }}



    Here's example JSON:

    Code:
    [{messageId: 21,
    sender: 'JOHN SMITH',
    tos: [{nodeId: 4, nodeName: "NODE NAME"}, {nodeId: 6, nodeName: "NODE NAME 2"}],
    subject: "SUBJECT TEXT"
    }, another message object]


    Thanks for any help you guys can provide!!


  2. Hi--

    Out of the box, there's no way to do this via configuration (at least not in Ext JS 4...in Ext JS 5+ you could use widgets). However, you might take a look at this user extension which seems to apply to what you're wanting:

    https://www.sencha.com/forum/showthr...-in-Grid-Cells

    Thanks!
    Joel

  3. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446
    Vote Rating
    186
      0  

    Default

    Hi--

    Out of the box, there's no way to do this via configuration (at least not in Ext JS 4...in Ext JS 5+ you could use widgets). However, you might take a look at this user extension which seems to apply to what you're wanting:

    https://www.sencha.com/forum/showthr...-in-Grid-Cells

    Thanks!
    Joel

  4. #3
    Sencha User
    Join Date
    Jul 2015
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Didn't have time to try this out before the feature was due so I just added a property to each record that held the first value of the array instead of showing all of them in a combo. I wish it worked out of the box but thanks for all your help guys

Similar Threads

  1. Replies: 1
    Last Post: 10 Feb 2015, 5:40 AM
  2. Replies: 1
    Last Post: 31 Dec 2014, 1:14 PM
  3. Replies: 1
    Last Post: 18 Sep 2014, 9:40 PM
  4. [FIXED] x-grid-cell-last on a one column grid.Panel
    By corneadoug in forum Ext:Bugs
    Replies: 2
    Last Post: 25 Nov 2012, 8:44 PM

Posting Permissions

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