1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    India
    Posts
    94
    Vote Rating
    0
    nikhilkrishnan is on a distinguished road

      0  

    Default Unanswered: cellEditing plugin and ComboBox

    Unanswered: cellEditing plugin and ComboBox


    Hi, I have a grid with cellEditing plugin and a comboBox as the editor.
    Now after i select a value from the comboBox the grid shows selected values 'id'. But i need to show the selected values text value on grid and set corresponding values 'id' in the record.

    Code:
    {
                                        xtype: 'gridpanel',
                                        id:'contentOrder_grid',
                                        store: theaterList_store,
                                        height: 525,
                                        title:'Theater List',
                                        columns: [{xtype: 'rownumberer', text:'SI',width:30},
                                            {
                                                text   : 'Theater',                                
                                                sortable : true,
                                                dataIndex: 'theater_name',
                                                flex:1                                        
                                            },
                                            {
                                                text:'Language',
                                                dataIndex:'language',                                            
                                                editor:{
                                                    xtype:'combo',
                                                    store:languageStore,
                                                    valueField:'language_id',
                                                    displayField:'language',
                                                    queryMode:'local'
                                                }
                                            },
                                            {
                                                text   : 'Delivery Date',
                                                sortable : true,    
                                                allowBlank:false,                                
                                                dataIndex: 'delivery_date',
                                                renderer:function(v){
                                                    return (v && isValidDate(v))?Ext.Date.format(v,'d-M-Y'):v;
                                                },
                                                editor: {
                                                    xtype: 'datefield',                                    
                                                    format : 'd-M-Y',
                                                    listeners:{
                                                        focus: function(showPicker) {
                                                            showPicker.onTriggerClick();                                                                
                                                        },
                                                        'select':function(){
                                                        }
                                                    }            
                                                }
                                            },{
                                                text   : 'Start Date',
                                                sortable : true,    
                                                allowBlank:false,                                
                                                dataIndex: 'start_date',
                                                renderer:function(v){
                                                    return (v && isValidDate(v))?Ext.Date.format(v,'d-M-Y'):v;
                                                },
                                                editor: {
                                                    xtype: 'datefield',                                    
                                                    format : 'd-M-Y',
                                                    listeners:{
                                                        focus: function(showPicker){
                                                            showPicker.onTriggerClick();                                                                
                                                        }
                                                    }                    
                                                }
                                            },{
                                                text   : 'End Date',
                                                sortable : true,    
                                                allowBlank:false,                                
                                                dataIndex: 'end_date',
                                                renderer:function(v){
                                                    return (v && isValidDate(v))?Ext.Date.format(v,'d-M-Y'):v;
                                                },
                                                editor: {
                                                    xtype: 'datefield',                                
                                                    format : 'd-M-Y',
                                                    listeners:{
                                                        focus: function(showPicker){
                                                            showPicker.onTriggerClick();                        
                                                        }
                                                    }                    
                                                }
                                            },{
                                                text:'product_id',
                                                flex:1,
                                                dataIndex:'screen_id',
                                                hidden:true
                                            }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,650
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Specify a renderer on the column and return what you need to display. I would keep the dataIndex to the id.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread