1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    59
    Vote Rating
    0
    extjser12 is on a distinguished road

      0  

    Default Unanswered: CellEditing change editor of other cell

    Unanswered: CellEditing change editor of other cell


    Hello together

    Can somebody help me to change the editor of another cell?

    Code:
    plugins: [{
        ptype: 'cellediting',
        listeners: {
            edit: function(editor, e, eOpts) {
                //How can I here change the editor of the next cell on the right side (e.colIdx + 1)?
    
            }
        }
    }],
    Thanks for your support in advance!

    Kind regards, extjser12

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,077
    Answers
    674
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You could just change the field value in the store itself.

    Scott.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    59
    Vote Rating
    0
    extjser12 is on a distinguished road

      0  

    Default


    Is it not possible to change the editor of another field? I want to achieve, that if a specific value is selected in a combobox another cell gets another editor.

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,364
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Looks like you can use grid.column.Column's setEditor method.
    http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Column-method-setEditor

    g
    rid.headerCt.down('gridcolumn[dataIndex="dependantColumn"]').setEditor({...})

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    59
    Vote Rating
    0
    extjser12 is on a distinguished road

      0  

    Default


    Nice. Thanks for your help!

    Is it also possible to extend your selector, so that it searchs for the "dataIndex" only in a specific row (e.g. e.rowIdx)?

    Kind regards, extjser12

  6. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,364
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Hmm... I think for that I might hook into the cell/row edit event
    http://docs.sencha.com/ext-js/4-0/#!...ing-event-edit

    That would give me the row I'm working on at the time that I'm executing setEditor().

  7. #7
    Sencha User
    Join Date
    Feb 2012
    Posts
    59
    Vote Rating
    0
    extjser12 is on a distinguished road

      0  

    Default


    Yes I know. But I need an other row in the same column and I don't know how can I do this? Do you have any idea?

    Kind regards, extjser12

  8. #8
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,364
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Not sure how to do that exactly. I know that the setEditor is done by column, though, if that helps. Good luck.

  9. #9
    Sencha User
    Join Date
    Feb 2012
    Posts
    59
    Vote Rating
    0
    extjser12 is on a distinguished road

      0  

    Default Down() method return all matched cells

    Down() method return all matched cells


    Ok thanks. Maybe I can iterate throught all returned cells from the "down()" method and select then the right cell. But the "down()" method returns me only the first match. Do you maybe know how can I get all cells with the same "dataIndex"?

    Thank you very much for your support!

    Kind regards, extjser12

  10. #10
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,364
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I've not used it, but looks like grid.getView().getCell(param1, param2) is the method you'd be after.
    param1 = record you're working with
    param2 = column

    You'd have to iterate the store to get each record, but with the previous selector you'd have the column you're interested in.

Thread Participants: 2