PDA

View Full Version : EXTJS 3.2 editorgrid How to set focus to next cell



kolenx
30 Dec 2014, 10:23 PM
from a combo box I get the value to (sat_beli,kon_beli,satuan), I want to set focus to next cell (start edit). Can U help please




{
dataIndex : 'kode_sub',
header : 'Kode Stock',
width : 160,
align : 'left',
editor : {
xtype : 'combo',
allowBlank : true,
mode : 'local',
store : ds_stock,
selectOnFocus: true,
listClass : 'x-combo-list-small',
typeAhead : true,
displayField : 'kode_sub',
itemSelector: 'div.column-center-akun',
valueField : 'kode_sub',
tpl : resultTpl_stock,
listWidth : 600,
lazyRender : true,
listeners: {
select : function(combo,e,rec) // 'select' will be fired as soon as an item in the ComboBox is selected with mouse, keyboard.
{
var invoice = this.getValue(); // get value from combo
var index = this.getStore().findExact('kode_sub',invoice) // compare value from combo to field acct_no and returns the index
var record = this.getStore().getAt(index); // get record at the index
//alert(record);
var processed1 = record.get('sat_beli'); // return value of field acct_name
var processed2 = record.get('konv_beli');
var processed3 = record.get('satuan');
//alert(processed);
var oSM = gridDetail.getSelectionModel();
var oGrid = Ext.getCmp('grid-Detail');
oGrid.startEditing(oSM.getSelectedCell()[0],oSM.getSelectedCell()[1]);
oGrid.getStore().getAt(oSM.getSelectedCell()[0]).set('sat_beli',processed1);
oGrid.getStore().getAt(oSM.getSelectedCell()[0]).set('konv_beli',processed2);
oGrid.getStore().getAt(oSM.getSelectedCell()[0]).set('satuan',processed3);


oGrid.stopEditing(false);

}

}


}
}

lumberjack
7 Jan 2015, 1:42 PM
The fiddle below demonstrates how you might begin editing the next sibling cell.

Note: This is in Ext JS 3.3 as 3.2 is not available in the fiddle application.

Regards,
Brian

g1a