PDA

View Full Version : Need Help Combo box ExtJS 3



mamay08
12 Sep 2011, 3:47 AM
hey guys, i really need your help..
i have combo box with ds_bunga store looks like this:
28009


table structure in Mysql looks like this:
id | nama_bunga | harga_satuan
, my question is how i can get "harga_satuan" value automatically into my "harga_satuan" field since i select "nama_bunga".
my friend tell me tu use "listeners", i dont really understand the concept.
this is my combo box code:


{
xtype: 'gridcolumn',
dataIndex:'nama_bunga',
selectOnFocus:true,
header: 'nama_bunga',
sortable: true,
width: 100,
editor: {
xtype: 'combo',
store:ds_bunga_faktur,
displayField:'nama_bunga',
valueField:'nama_bunga',
triggerAction:'all',
typeAhead:true,
mode:'local'
}
},

please help me guys :D

aacoro
12 Sep 2011, 11:50 AM
Did you checked out the API? Link:

sample code:




var cb = new Ext.form.ComboBox({ // all of your config options listeners:{ scope: yourScope, 'select': yourFunsction }});

yourFunction can have 3 parameters (see API). Or you can use:




onSelect: function(record){ // do something with your record }

Good luck!