PDA

View Full Version : get grid cell value



igi
14 Dec 2009, 8:55 PM
this is my code


grid_wisata_id.on('cellclick',function(grid_wisata_id, rowIndex, columnIndex, e){
if(columnIndex ==7){
var record_wisata = grid_wisata_id.getStore().getAt(rowIndex);
var fieldName_wisata = grid_wisata_id.getColumnModel().getDataIndex(0);
var id_wisata_klik = record_wisata.get(fieldName_wisata);

var record_wisata_jenis = grid_wisata_id.getStore().getAt(rowIndex);
var fieldName_wisata_jenis = grid_wisata_id.getColumnModel().getDataIndex(1);
var id_wisata_klik_jenis = record_wisata_jenis.get(fieldName_wisata_jenis);

<--cut..>

id_wisata_detail_id.setValue(id_wisata_klik);
cmb_wisata_group_id_detail.setValue(id_wisata_klik_jenis);

<--cut-->
}
}
assume grid has 12 rows, Can I shorten the code above ?, my code too long if i select one by one cell