Nov 05, 2010, 7:16 PM
[CLOSED] Problem when showing/hiding controls in javascript
Hi,
I have a ComboBox with a list of items and each one refers to a data type (text, number, and date). When I select an item a different field is shown to the user.
The problem is that when I execute this action the ComboBox gets behind the other control. It was not happening on Ext.Net.dll version 1.0.3909.21027.
Now I'm using Ext.Net.dll version 1.0.3960.22203.
NOTE: I need all controls inside a CompositeField and the Text, Number and Date fields must to be Flex=1.
Follows the example code.
I have a ComboBox with a list of items and each one refers to a data type (text, number, and date). When I select an item a different field is shown to the user.
The problem is that when I execute this action the ComboBox gets behind the other control. It was not happening on Ext.Net.dll version 1.0.3909.21027.
Now I'm using Ext.Net.dll version 1.0.3960.22203.
NOTE: I need all controls inside a CompositeField and the Text, Number and Date fields must to be Flex=1.
Follows the example code.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function cmbField_Change()
{
var value = cmbFields.getValue();
textField.setVisible(value == 0);
numberField.setVisible(value == 1);
dateField.setVisible(value == 2);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel runat="server" Title="Test">
<Items>
<ext:CompositeField runat="server" FieldLabel="Type">
<Items>
<ext:ComboBox ID="cmbFields" runat="server" SelectedIndex="0" Width="120" >
<Items>
<ext:ListItem Value="0" Text="Text" />
<ext:ListItem Value="1" Text="Number" />
<ext:ListItem Value="2" Text="Date" />
</Items>
<Listeners>
<Change Handler="cmbField_Change();" />
<Select Handler="cmbField_Change();" />
</Listeners>
</ext:ComboBox>
<ext:TextField ID="textField" runat="server" Flex="1" />
<ext:NumberField ID="numberField" runat="server" Hidden="true" Flex="1" />
<ext:DateField ID="dateField" runat="server" Hidden="true" Flex="1" />
</Items>
</ext:CompositeField>
</Items>
</ext:Panel>
</form>
</body>
</html>
Last edited by Daniil; Nov 05, 2010 at 8:55 PM.
Reason: [CLOSED]