PDA

View Full Version : [CLOSED] enable button in Listeners



hdsoso
Jun 01, 2013, 2:21 PM
<ext:Button ID="btn_save" runat="server" Icon="Disk" Text="确定" Disabled="True">
<DirectEvents>
<Click OnEvent="e_save" Before="return #{store_role}.isDirty();">
<ExtraParams>
<ext:Parameter Name="data" Value="#{store_role}.getChangedData()" Mode="Raw" Encode="true" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>



<ext:Button ID="btn_add" runat="server" Icon="Add" Text="新增">
<Listeners>
<Click Handler="App.store_role.insert(0,{});App.btn_save.disabled= false;"></Click>
</Listeners>
</ext:Button>

I set btn_save button disabled, when I click btn_add button ,set btn_save button enabled.


App.btn_save.disabled=false;

is not work, is sth. wrong?

hdsoso
Jun 01, 2013, 2:57 PM
App.btn_save.disabled=false;
then button can click , but button's color is gray .

Vladimir
Jun 01, 2013, 5:35 PM
Please use disable method


App.btn_save.disable();


Please see
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.AbstractComponent-method-disable