hello everyone, i have a problem when i want to configure classes,
for example, i create a class extends from combobox
PHP Code:
var releasestore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: './php/backend.php',
method: 'POST'
}),
baseParams:{task: "showRelease"},
reader: new Ext.data.JsonReader({
root: 'release'
//root: 'results',
//totalProperty: 'total'
}, [
{name: 'appli', mapping : 'Appli'},
{name: 'release', mapping : 'IdRelease'}
])
});
Application.ComboRelease = Ext.extend(Ext.form.ComboBox, {
border:false
,initComponent:function() {
Ext.apply(this, {
store: releasestore,
displayField:'release',
typeAhead: true,
//mode: 'local',
triggerAction: 'all',
emptyText:'Release',
fieldLabel:'Release',
selectOnFocus:true,
width:100
});
Application.ComboRelease.superclass.initComponent.apply(this, arguments);
}
,onRender:function() {
Application.ComboRelease.superclass.onRender.apply(this, arguments);
}
});
Ext.reg('ComboRelease', Application.ComboRelease);
it works well when i add to the panel , but in another function i need the selected value from this combobox,
function PDFClick(btn){
var item = ComboRelease.getValue();
}
then it will create an error, "ComboRelease not defined", so how can i use the classes i defined??
the same problem when i create a toolbar, how can i use this function Mytoolbar.addField(comboPDFTpye);
PHP Code:
Application.Mytoolbar = Ext.extend(Ext.Toolbar, {
initComponent:function() {
Ext.apply(this, {
});
Application.Mytoolbar.superclass.initComponent.apply(this, arguments);
}
,onRender:function() {
Application.Mytoolbar.superclass.onRender.apply(this, arguments);
}
});
Ext.reg('Mytoolbar', Application.Mytoolbar);
Mytoolbar.addField(comboPDFTpye);
Mytoolbar.add(
{
text: 'PDF',
enableToggle: true,
toggleHandler: PDFClick,
pressed: true
});
I am a beginner, really hope someone can help, thanks