-
Ext.Msg.notify
I have a combobox that I have added a notification. How I can display the contents of the combobox in the notification?
Code:
<ext:ComboBox ID="camp"
runat="server"
Editable="false"
FieldLabel="CampaƱa"
StoreID="dsCampas"
DisplayField="Name"
ValueField="CampaignID"
ForceSelection="true"
TypeAhead="true"
TriggerAction="All"
Mode="Remote"
AllowBlank="false"
PageSize="10"
SelectOnFocus="false"
AnchorHorizontal="100%"
DataIndex="Name"
>
<Listeners>
<BeforeSelect Handler="#{Button2}.setDisabled(false);Ext.Msg.notify('Button Click', camp.ValueField );" />
</Listeners>
</ext:ComboBox>
I've tried #{camp}.getvalue(), camp.value, camp.displayvalue .... and I did not succeed.
If for example I use camp.mode I get me out remote
Thanks and sorry for my bad English
-
Hi,
I believe it would be #{camp}.getValue(). Please note the use of the uppercase 'V' in Value.
Example
-
More information available in the client-side docs, see
http://dev.sencha.com/deploy/dev/doc...ember=getValue
-
I've tried #{camp}.getValue() and I did not succeed.
-
I tested a simplified version of your code and it does appear to work correctly when calling .getValue().
Example
Code:
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!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 runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:ComboBox
ID="ComboBox1"
runat="server"
FieldLabel="Country">
<Items>
<ext:ListItem Text="Austria" />
<ext:ListItem Text="Bulgaria" />
<ext:ListItem Text="Canada" />
</Items>
<Listeners>
<Select Handler="Ext.Msg.notify('Value', #{ComboBox1}.getValue());" />
</Listeners>
</ext:ComboBox>
</form>
</body>
</html>
In the code you posted, you have configured the <BeforeSelect> event, which will fire before the item has been selected. This will give the affect of appearing to return the last item, not the current item.
I've changed to the <Select> event in my code.
Hope this helps.