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

      0  

    Question Unanswered: CellEditing : How to access editors in a row

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,547
    Vote Rating
    872
    Answers
    3566
    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


    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 @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