PDA

View Full Version : How to Update Elements using event cellclick ?



suwidadi
10 May 2010, 4:22 AM
Hi there, i have viewport and i would like to add an event 'click' on center region and update south region. but it never works. any help would be appreciate.
here's my code :



new Ext.Viewport({
layout:'border',
defaults: {
collapsible: true,
split: true,
autoScroll:true,
bodyStyle: 'padding:0px'
},
items: [{
id: 'idSouth',
region: 'south',
titleCollapse: true,
autoScroll: false,
},{
id: 'idCenter',
title: 'Daftar Pasien Poli',
layout: 'border',
collapsible: false,
items: grid
}]
});

var grid = new Ext.grid.EditorGridPanel({
title:'Data Pasien Poli',
store: pasienStore,
stripeRows:true,
columns: [
new Ext.grid.RowNumberer({
header: 'No',
width: 30,
dataIndex : '',
sortable: false,
}),{
header:'Add',
width: 30,
dataIndex: 'data_icon',
sortable: false,
renderer: cover_image,
}]
});

grid.on('cellclick',function(grid, rowIndex, columnIndex, e) {
if(!detailElSouth){
var bdSouth = Ext.getCmp('idSouth').body;
bdSouth.update('').setStyle('background','#fff');
detailElSouth = bdSouth.createChild();
}
detailElSouth.hide().update(Ext.getDom.('grid2id').innerHTML).slideIn('l', {stopFx:true,duration:.2});
})