Results 1 to 5 of 5

Thread: Issue w/ dynamic grid with combobox columns

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default Answered: Issue w/ dynamic grid with combobox columns

    Hi, I'm using extjs 4.1 final. I'm creating dynamic grids using the reconfigure method. A couple of my columns need to be a combobox so I have an event listener for beforedit, which in this case checks which column it is, if its the correct column, it sets the column editor to a combobox and the combobox is linked to a store. The issue I'm having is the first time the grid is configured, the comboboxes work fine. I can select the cells within the columns that I defined as a combobox and I can select the values. But once I reconfigure the grid, there is an issue w/ the comboboxes. When I click on a column w/ the comboboxes, the dropdown gets rendered out of place and I can't select the values. I get an error stating "Uncaught TypeError: Cannot read property 'offsetHeight' of undefined ext-all-debug.js:16417"

    combobox.jpg
    I'm not sure if its a bug or it's an issue w/ the way I'm implementing it. Any help would be great. Thanks in advance.

  2. comment out: id: 'id', see if this helps.

    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,388
    Answers
    716
    Vote Rating
    499
      0  

    Default

    Do you create a new instance of the combo each time you reconfigure?
    Does the combo each time? console.log(combo) after reconfig?

    Regards,
    Scott.

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by scottmartin View Post
    Do you create a new instance of the combo each time you reconfigure?
    Does the combo each time? console.log(combo) after reconfig?

    Regards,
    Scott.
    I used the beforeedit event. What it does is it checks to see if its the column I want, if yes than it sets the column editor so if its a column that I want to be a combobox I do.
    event.column.setEditor({
    xtype: 'combobox',
    id: id,
    displayField: prop,
    valueField: prop,
    store: this.getMyStore(),
    queryMode: 'local',
    triggerAction: 'all',
    lastQuery: '',
    editable: true
    });

    I know this isn't efficient since I would be setting the editor every time I click on one of the combobox column cell's. But it works fine for the initial grid when I reconfigure it again this is when I run into an issue. I thought it would be fine since running the reconfigure would create new columns and get rid of the old editor settings.

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,388
    Answers
    716
    Vote Rating
    499
      0  

    Default

    comment out: id: 'id', see if this helps.

    Scott.

  6. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by scottmartin View Post
    comment out: id: 'id', see if this helps.

    Scott.
    Thanks Scott you helped me solve my issue. By getting rid of the id, I realized it was an error caused by me referencing that id and listening for the expand event. I was trying to link up my comboboxes, where the value of one box affects the other. I added my logic else where and am no longer listening for that event for that specific combobox id and it seems to work fine now. Thanks again

Tags for this Thread

Posting Permissions

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