PDA

View Full Version : listener submit checkbox



mikitracey
23 Feb 2009, 7:12 AM
Hi there.
I'm doing a lot better, but am stumped on this one. I even tried adding id's to the items.

I have searched the examples and just want to be sure. I have several formpanels containing combo boxes and textboxes. These are autosubmitting using listeners no problem. I just tried to create a checkboxgroup and a checkbox and for some reason i'm not clear on, these formpanels are not autosubmitting based on listeners (i tried click, blur and select events).

Is there something inherently wrong with the following code?

// create the TYPE form panel
var type_form = new Ext.FormPanel({
url: 'act_set_session_vars.cfm',
renderTo: 'type',
frame: true,
title: 'Grant Type:',
width: 190,
collapsible: true,
items: [
<cfoutput query="qGrantTypes">
{
xtype: 'checkbox',
hideLabel: true,
name: 'grant_type_id',
//if it is the selected value, check it
boxLabel: '#label_gfs_display#',
listeners: {
blur: function(f,r,i){
type_form.getForm().submit({
success: function(f,a){
resultsStore.load();
resultsGrid.render();
}
});
}
}

},
</cfoutput>
{
xtype:'checkbox',
hideLabel: true,
name: 'grant_type_id',
//if it is teh selected value, check it
boxLabel: 'ALL',
listeners: {
change: function(f,r,i){
type_form.getForm().submit({
success: function(f,a){
resultsStore.load();
resultsGrid.render();
}
});
}
}
}]
});

If I am correct, and listeners just dont' work for some reason..that would mean that i need to write some JS/EXT that responds to an onSelect(blur,click) event. If so, could somebody make some suggestions as to how?