PDA

View Full Version : [CLOSED] V2.0 ToolBar Button



Aurelio
Jan 23, 2012, 9:37 AM
Hi, please help my to disable - enable the button in a toolbar..

in a versione 1.2 client-side javascript myButton.setDisabled(false) work, but in 2.0 retrive an error.


<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>
<ext:Panel ID="Panel1" runat="server" Region="West" Width="200" BodyPadding="3" Layout="FitLayout">
<Items>
<ext:GridPanel ID="GridPanelUtenti" runat="server" Title="Archivio utenti">
<Store>
<ext:Store runat="server" ID="StoreUtenti">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="UteId">
<Fields>
<ext:ModelField Name="UteId" />
<ext:ModelField Name="UteUte" />
<ext:ModelField Name="UteEma" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" ID="UteUte" DataIndex="UteUte" Align="Left" Flex="1" Text="Utenti" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel>
<Listeners>
<Select Handler="enableButton(record);" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:FormPanel ID="FormPanelUtenti" runat="server" ButtonAlign="Right" Height="185"
BodyPadding="10" Padding="3" Title="Utente" Region="Center" Flex="1">
<Items>
<ext:TextField ID="TextField1" runat="server" AnchorHorizontal="100%" FieldLabel="Label">
</ext:TextField>
</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarUtenti" >
<Items>
<ext:Button ID="ButtonNew" runat="server" Text="Nuovo"
Scale="Medium" IconUrl="Images/24/new24.png" ToolTip="Crea un nuovo utente." Disabled="True">
</ext:Button>
<ext:Button ID="ButtonEdit" runat="server" Text="Modifica" Disabled="true"
Scale="Medium" IconUrl="Images/24/edit24.png" ToolTip="Modifica l'utente selezionato.">
</ext:Button>
<ext:Button ID="ButtonDelete" runat="server" Text="Cancella"
Scale="Medium" IconUrl="Images/24/delete24.png" ToolTip="Cancella l'utente selezionato.">
</ext:Button>
<ext:ToolbarFill />
<ext:Button ID="ButtonSave" runat="server" Text="Salva"
Disabled="true" Scale="Medium" IconUrl="Images/24/save24.png" ToolTip="Salva le modifiche apportate">
</ext:Button>
<ext:Button ID="ButtonCancel" runat="server" Text="Annulla" Disabled="true"
Scale="Medium" IconUrl="Images/24/cancel24.png" ToolTip="Annulla le modifiche apportate">
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:FormPanel>
</Items>
</ext:Viewport>
</form>
<script type="text/javascript">

function enableButton (record) {

if (record != null) {
ButtonEdit.setDisabled(false);

}

};

</script>
</body>

I have test with:

ButtonEdit.isDisabled
ButtonEdit.setDisabled
ButtonEdit.disable

but the button is always disabled.

In the sample: http://examples2.ext.net/#/Form/Miscellaneous/Edit_Form_View/
the button save is always disable, i have the same problem..

tnks

Aurelio

Daniil
Jan 23, 2012, 10:02 AM
Hi,

Please see:
http://forums.ext.net/showthread.php?17020&p=73029&viewfull=1#post73029

We will add a respective CHANGELOG item.

Update

The respective CHANGELOG item #90 has been added.
http://examples2.ext.net/#/Getting_Started/Release_Documents/CHANGELOG/

Aurelio
Jan 23, 2012, 10:16 AM
Thanks Daniil...is work OK

App.ButtonDelete.setDisabled(false);

Now Print the entire log and append on my Monitor !!! :)

Thanks

Aurelio