Nov 11, 2010, 4:04 PM
[OPEN] [#116] Problem to reset a combo
instead of reset the combo, set the item (Arizona) that has ID = 0.
I can not change the value to be 0.
What do you advise me to do to fix this?
I can not change the value to be 0.
What do you advise me to do to fix this?
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
this.Store1.DataSource = new object[]
{
new object[] { 60, "Alabama", "The Heart of Dixie" },
new object[] { 1, "Alaska", "The Land of the Midnight Sun" },
new object[] { 0, "Arizona", "The Grand Canyon State" },
new object[] { 3, "Arkansas", "The Natural State" }
};
this.Store1.DataBind();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Basic Hello World Window - Ext.NET Examples</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="Button1" runat="server" Text="Button #1">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().reset();" />
</Listeners>
</ext:Button>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="abbr" />
<ext:RecordField Name="state" />
<ext:RecordField Name="nick" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:Store ID="StoreStati" runat="server">
<Reader>
<ext:JsonReader IDProperty="ID">
<Fields>
<ext:RecordField Name="ID" />
<ext:RecordField Name="Name" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<LoadException Handler="Ext.Msg.alert('Employees - Load failed', e.message || response.statusText);" />
</Listeners>
</ext:Store>
<ext:FormPanel
ID="FormPanel1"
runat="server"
Width="400">
<Items>
<ext:ComboBox
ID="ComboBox1"
runat="server"
StoreID="Store1"
Editable="false"
DisplayField="state"
ValueField="abbr"
TypeAhead="true"
Mode="Local"
ForceSelection="true"
EmptyText="Select a state..."
Resizable="true"
SelectOnFocus="true"
/>
</Items>
</ext:FormPanel>
</form>
</body>
</html>
Last edited by Daniil; Jan 04, 2013 at 12:48 PM.
Reason: [OPEN] [#116]