Oct 06, 2015, 3:56 PM
MultiSelect control by clicking on Select All button to select only few items based on combo box value
Hi Team,
we just converting ext.net version 1.6 to 2.5.3.
we have requirement, when I select combo box value is 4 then clicking select all button on the multi select control it should select only items 2 & 3 . It should not select item 1.
how can i acheive this task.
we have in the below 1.6 code is working fine replace method, but it 2.5.3 is throwing error
Pls find the error screen shot
we just converting ext.net version 1.6 to 2.5.3.
we have requirement, when I select combo box value is 4 then clicking select all button on the multi select control it should select only items 2 & 3 . It should not select item 1.
how can i acheive this task.
we have in the below 1.6 code is working fine replace method, but it 2.5.3 is throwing error
#{testmlselDegreeProgrammes}.setValue(#{testmlselDegreeProgrammes}.getValue().replace('30',''));
Please find the test case<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestMultTwoitems.aspx.cs" Inherits="Jobs.TestMultTwoitems" %>
<%@ 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 id="Head1" runat="server">
<title>Multi Select Ext.Net Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Panel ID="pnlEmployer" runat="server" LabelWidth="1" Layout="FormLayout" Width="500">
<Items>
<ext:ComboBox runat="server" Name="Course" ID="cbxEmploymentType" Selectable="true" Editable="false" HideTrigger="false" Hidden="false"
Width="100px">
<Items>
<ext:ListItem Text="Fulltime" Value="4" />
<ext:ListItem Text="partime" Value="5" />
<ext:ListItem Text="none" Value="6" />
</Items>
</ext:ComboBox>
<ext:MultiSelect ID="testmlselDegreeProgrammes" runat="server">
<Items>
<ext:ListItem Text="Item 1" Value="30" />
<ext:ListItem Text="Item 2" Value="32" />
<ext:ListItem Text="Item 3" Value="33" />
</Items>
</ext:MultiSelect>
<ext:Button ID="btnSelectAllDegrees" runat="server" Disabled="false" StandOut="True" Text="Select All">
<Listeners>
<Click Handler="#{testmlselDegreeProgrammes}.boundList.getSelectionModel().selectAll();
if (#{cbxEmploymentType}.getValue() == '4') {
console.log(#{cbxEmploymentType}.getValue());
console.log(#{testmlselDegreeProgrammes}.getValue());
#{testmlselDegreeProgrammes}.setValue(#{testmlselDegreeProgrammes}.getValue().replace('30',''));
console.log(#{testmlselDegreeProgrammes}.getValue());
#{lblAuthorisedTrainingOrg}.show();
Ext.Msg.alert('Test Programme', 'If you have chosen \'Item 2 & 3\' then, you may not choose item 1.');};" />
</Listeners>
</ext:Button>
<ext:Button ID="btnClearAll" runat="server" StandOut="True" Text="Clear All">
<Listeners>
<Click Handler="#{testmlselDegreeProgrammes}.clear();
#{lblAuthorisedTrainingOrg}.hide(); " />
</Listeners>
</ext:Button>
<ext:Label ID="lblAuthorisedTrainingOrg" runat="server" Text="Test" Hidden="true"></ext:Label>
</Items></ext:Panel>
</form>
</body>
</html>
Pls find the error screen shot