Results 1 to 2 of 2

Thread: cellEditing plugin and ComboBox

  1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    India
    Posts
    94
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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