Results 1 to 5 of 5

Thread: Multiple Editors For One Column

  1. #1
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    100
    Answers
    5
    Vote Rating
    4
      0  

    Question 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
    100
    Answers
    5
    Vote Rating
    4
      0  

    Default

    Has someone an idea?

  3. #3
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Answers
    109
    Vote Rating
    93
      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
    100
    Answers
    5
    Vote Rating
    4
      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 User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Answers
    109
    Vote Rating
    93
      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.

Posting Permissions

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