PDA

View Full Version : Button is showing as disabled,but event is firing after using disable()



malli1988
10 Jun 2015, 2:47 AM
this.buttonPanel = new Ext.Panel({
renderTo: Ext.getBody(),
bodyStyle: 'margin:0px 0px 75px 75px',

layout:'hbox',
items: [{

id: 'search-submit-button',
disabled:true,

html: "<a class='link-button-dark-blue-new' href='javascript:runReports();'><span class='mid-part' style='font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;'> Submit <span class='arrow-part'></span></span><span class='right-part'></span></a>",
xtype: "label"},
{

id: 'search-clear-button',
html: "<a class='link-button-dark-blue-new' href='javascript:clear();'><span class='mid-part' style='font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;'>Clear<span class='arrow-part'></span></span><span class='right-part'></span></a>",
xtype: "label"}
]
});
...

I have used above code and able to disable but not able stop fire while cliking on Submit.Ext.getCmp(..).disable(); is also having same problem.Please post the suggessions.

tristan.lee
11 Jun 2015, 9:33 AM
Setting disabled on the panel item is not going to disable the link you're rendering as HTML. I see you're items are Labels but your rendered content is an anchor tag styled as a button. Any reason why not to just render a Button component?