1. #1
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Answers
    5
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Question Unanswered: Multiple Editors For One Column

    Unanswered: Multiple Editors For One Column


    Hello is it possible to have a Column, which has different Editors for a row?
    For example row 1 should have a Textfield, row 2 should have a ComboBox, row 3 is a CheckBox and so on...
    I did it not in a nice way. In the onBeforeStartEdit i switch the editor with the method addEditor and the ColumnConfig and the Field. But the ColumnConfig ist a String. I can't use in this way a CheckBox or a NumberField.
    If there is a nice solution, please tell me!
    Thanks!

  2. #2
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Answers
    5
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default


    Has someone an idea?

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    One option is to make your own field that is blank but draws other fields over it, of course after converting to the required type. For example, if the column holds a string, convert string to boolean, string to date, string to number. What object do you have in the ColumnConfig?

  4. #4
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Answers
    5
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default


    I can't get it work. I make a Field which extends ValueBaseField with my own Model (DcAttribute).
    And then i have to make my own Cell and then... and so on.

    My ColumnConfig ist in the moment:

    new ColumnConfig<DcAttribute, String>

  5. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Adding a field to the editor lets you specify a Converter object to turn the input data (string in this case) into whatever the field being added can handle. In other words, you can use addEditor(ColumnConfig<M, N> columnConfig, Converter<N, O> converter, Field<O> field) instead of addEditor(ColumnConfig<M, N> columnConfig, Field<N> field).

    If you don't want to build your own field or use the alternative method above, and have no general way of storing the data stored into the data displayed, I'm not sure how this could ever be implemented, with or without gxt.

Thread Participants: 1