Hybrid View

  1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    25
    Vote Rating
    0
    andreik65 is on a distinguished road

      0  

    Default different values for a ComboBox on each row of an EditorGrid

    different values for a ComboBox on each row of an EditorGrid


    Hello,

    I'm trying to manage different values for a ComboBox on each row of an EditorGrid.

    Basically, a column of the grid is a ComboBox whose selectable values are not statically defined at grid build time, but change every time the user selects a different row.

    Currently I'm using gwt-ext where they provided a method setUserCustomCellEditor on ColumnModel. You can pass it a subclass of UserCustomCellEditor. It's got one method, public GridEditor getCellEditor(int colIndex, int rowIndex). It's called any time a cell is about to enter editing. It gives me the ability to initialize the ComboBox with different values.

    How can I do it with Ext GWT?

    Thanks.
    Andrea

  2. #2
    Ext User
    Join Date
    Sep 2010
    Posts
    1
    Vote Rating
    0
    odwyers is on a distinguished road

      0  

    Default


    We are looking for this functionality as well in GXT where we can override a ColumnModel method getCellEditor(col, row) and provide a row specific cell editor for an EditorGrid.
    Has anyone achieved this ?

    Thanks,

    Sean

  3. #3
    Ext GWT Premium Member
    Join Date
    Dec 2011
    Posts
    3
    Vote Rating
    0
    routologic is on a distinguished road

      0  

    Default different cell editors in each row

    different cell editors in each row


    Hi all,

    we would also need the functionality in GXT to have different cell editors depending on the actual row data...
    Has anyone found a solution so far?

    Thanks,
    Gergely

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Posts
    2
    Vote Rating
    0
    vidj is on a distinguished road

      0  

    Default


    Hi everyone,

    we actually found a solution for ExtJS maybe it can be adapted for GWT:

    Grid-Col has an editor:
    PHP Code:
    {
                                           
    xtype:'editorgrid',
                                           
    id'somegrid',
                                           
    storethis.store,
                                           
    cm: new Ext.grid.ColumnModel([
                                              {
                                                 
    id:'some_category',
                                                 
    header'Category',
                                                 
    dataIndex'category_id',
                                                 
    rendererthis.getCategoryText
                                              
    },
                                              {
                                                 
    id:'category_val',
                                                 
    header'Value',
                                                 
    dataIndex'value_id',
                                                
    rendererthis.getValueText,
                                                        
    editor: new Ext.form.ComboBox({
                                                     
    id'value',
                                                     
    name'value',
                                                     
    mode'local',
                                                     
    storethis.valueStore//this is an empty store
                                                     
    valueField:'value_id',
                                                     
    displayField:'value_text'                                      
                                                
    })
                                              }
                                           ]),
                                          
    listeners:{
                                  
    beforeedit:this.getComboValues                                    
                                          
    }
                                        }
    // -- eo grid 
    then there is a function getComboValues:

    PHP Code:
    function getComboValues(e){

         var 
    combobox Ext.getCmp('value');
          
          
    //create tmp store for impact levels
          
    var tmpStore = new Ext.data.Store({
             
    reader: new Ext.data.JsonReader({
                
    root:'data',
                
    id'value_id',
                
    fields:['value_id','value_text']
             }, 
    Ext.data.Record.create([
                {
    name'value_id'},
                {
    name'value_text'}
             ])),
    //fill here your store with the specific data for the combobox
             
    datae.grid.valueStore.getById(e.record.get('category_id')).data
          
    });
          
          
    //bind the tmpStore to the combobox and set the value that was selected
          
    combobox.bindStore(tmpStore);
          
    combobox.setValue(e.value);
          
          return 
    true;

    hope i could help

    greetz

    vidj

  5. #5
    Ext GWT Premium Member
    Join Date
    Dec 2011
    Posts
    3
    Vote Rating
    0
    routologic is on a distinguished road

      0  

    Default


    Thanks vidj!

    I will see if I can implement it in GXT. Anyway, if somebody have already got it, do not hesitate to post a reply.

    Thanks once more,
    Gergely

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar