How to focus on editable textfield when checkbox is checked in ExtJS Grid? -


i creating grid checkcolumn , celledit. have 3 columns 1 checkboxes , other editable text field , 3rd productname, using celledit edit price.

when check checkbox on record focus should on textfield particular record.

here code sample:

ext.define('myapp.view.entrypage', { extend : 'ext.grid.panel', alias : 'widget.entrypage', title : 'product price entry', store : 'productstore', loadmask: true,  plugins: [ext.create('ext.grid.plugin.cellediting', {clickstoedit: 1})],  initcomponent:function(){      var me = this;     this.selmodel = {xtype:'cellmodel'},      this.columns = {                 defaults:{sortable : true,hideable : true,menudisabled : true,align : 'left',style : 'text-align:left'},                 items:[                           {                                xtype: 'checkcolumn',                               header: 'check me',                               dataindex : 'active',                               listeners:{                                checkchange : function( checkcolumn, rowindex, checked, eopts ){                               // select textfield                                }}                           },                           {                                text : 'price',                                flex:0.75,                                sortable : false,                                hideable : false,                                dataindex : 'unitprice',                                editor: 'textfield'                           },                           {                                text : 'product name',                                flex:2,                                dataindex : 'pname'                           }                     ]};          //this.features = [];         this.callparent(arguments);  }  }); 

with of listener(use edit event), if has been checked, reference of record , apply focus() method.

refer below link reference.

http://docs.sencha.com/extjs/4.0.7/#!/api/ext.grid.plugin.cellediting-event-edit

see edit event in above link.

thanks


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -