Sep 04, 2015, 4:20 AM
Multi Select "Get Value" and "select all" from client side
I am converting Ext.Net 1.6 to 2.5.3 version.
I also refer in the below post and Use code, but it is not working multiselect all items and getvalue indexof code in the 2.5.3 version.
Code:
http://forums.ext.net/showthread.php...om-client-side
My Requirement:
Task1:
If I select Item 1 then label1 text should be displayed otherwise label1 text
should be hidden.
Task 2: If i select all items then the inner Html error is throwing.
how can i achieve the above task and please help us on this issue.
I also refer in the below post and Use code, but it is not working multiselect all items and getvalue indexof code in the 2.5.3 version.
Code:
http://forums.ext.net/showthread.php...om-client-side
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test11.aspx.cs" Inherits="JPortal.Test11" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<script runat="server">
protected void SelectAll(object sender, DirectEventArgs e)
{
for (int i = 0; i < MultiSelect1.Items.Count; i++) {
MultiSelect1.SelectedItems.Add(new SelectedListItem(MultiSelect1.Items[i].Value));
}
MultiSelect1.UpdateSelectedItems();
}
</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="Head2" runat="server">
<title>Ext.Net 2.5.3 Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:MultiSelect ID="MultiSelect1" runat="server">
<Items>
<ext:ListItem Text="Item 1" Value="Value1" />
<ext:ListItem Text="Item 2" Value="Value2" />
<ext:ListItem Text="Item 3" Value="Value3" />
</Items>
<ListConfig ID="ListConfig1" runat="server">
<Listeners>
<ItemClick Handler="if (#{MultiSelect1}.getValue().indexOf('Value1') != -1) {
#{label1}.show();
} else {
#{label1}.hide();
};" />
</Listeners>
</ListConfig>
</ext:MultiSelect>
<ext:Label ID="label1" runat="server" Text="Item1 Selected" Hidden="true"></ext:Label>
<ext:Button ID="Button1" runat="server" Text="Select all">
<DirectEvents>
<Click OnEvent="SelectAll" />
</DirectEvents>
</ext:Button>
</form>
</body>
</html>
Error:My Requirement:
Task1:
If I select Item 1 then label1 text should be displayed otherwise label1 text
should be hidden.
Task 2: If i select all items then the inner Html error is throwing.
how can i achieve the above task and please help us on this issue.
Last edited by yenkarthi; Sep 04, 2015 at 4:26 AM.