Results 1 to 2 of 2

Thread: CellEditing : How to access editors in a row

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

    Question CellEditing : How to access editors in a row

    Hi,

    I have gridpanel with cellEditing plugin. The users can add row dynamically and are allowed to set Delivery date ,Start Date, and End Date. Both Start date and End Dates will disabled by default. I want to enable the start date field when the user select delivery date and set the minimum date greater than or equal to selected delivery date . How can i implement this ? I have done this using a normal form but not in a grid .....
    Code:
    {
                                        xtype: 'gridpanel',
                                        id:'contentOrder_grid',
                                        store: tList_store,
                                        height: 525,
                                        title:'TList',
                                        columns: [{xtype: 'rownumberer', text:'SI',width:30},
                                            {
                                                text   : 'TName',                                
                                                sortable : true,
                                                dataIndex: 't_name',
                                                flex:1                                        
                                            },
                                            {
                                                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',
                                                    disabled:true,
                                                    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',
                                                    disabled:true,                                    
                                                    format : 'd-M-Y',
                                                    listeners:{
                                                        focus: function(showPicker){
                                                            showPicker.onTriggerClick();                        
                                                        }
                                                    }                    
                                                }
                                            },{
                                                text:'product_id',
                                                flex:1,
                                                dataIndex:'screen_id',
                                                hidden:true
                                            }],
                                        tbar: [{
                                                itemId: 'rt',
                                                text: 'Remove t',
                                                iconCls: 'remove',
                                                handler: function() {
                                                }
               
                                            }]
                                        ,plugins: [cellEditing]
                                    }
    I have posted a question in 'Discussions' but didn't get any response yet...

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You are using CellEditing so there is only one editor at one time. You can get the value of a cell by going to the Store and getting the record. If you want to start editing on a cell based on another cell the CellEditing plugin has a startEdit and startEditByPosition methods.
    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

Posting Permissions

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