Thursday, 15 May 2014

ExtJs Upload File-FileField + file format as a jpg and change fake path



                                                        xtype: 'filefield',
                        fieldLabel: 'file',
                        id:'edId'+,
                        regex: /^.*\.(jpg|jpeg|JPG|JPEG)$/,
                                                regexText:'Not a valid file type, please upload jpg files.',
                                               listeners: {
                                                 change: function(fld, value) {
                                                   var newValue = value.replace(/C:\\fakepath\\/g, '');
                                                fld.setRawValue(newValue);
                                             }
                                         }

Friday, 25 April 2014

Extjs-on blur change event for complete cursor

Ext.getCmp('someGridName').editingPlugin.completeEdit();


Example-

                                            xtype: 'button',
                                   maxHeight: 23,
                                   style: 'margin-left:650px;',
                                   iconCls: 'saveicon',
                                   text: 'Ok',
                                   listeners:{
                                    click: function(){
                                    Ext.getCmp('Grid').editingPlugin.completeEdit();
                                                         }
                                                       }

Monday, 14 April 2014

Extjs-set width and height of combo box

                        xtype: 'combobox',
                        fieldLabel: 'User',
                        labelAlign: 'right',
                        name:'client',
                        displayField:'name',
                        valueField:'id',
                        listConfig:{              // set popup- width and height of combo 
                                                                        width:300,
                                                                         height:200,
                                                                         autoHeight:true
                                                        },
                                                      matchFieldWidth :false, //mandatory
                        store:Ext.create('MyApp.store.ClientStore'),