[CLOSED] How to get the selected items from a multicombo via js

  1. #1

    [CLOSED] How to get the selected items from a multicombo via js

    Hello,

    I have a multicombo control. I have button next to it. My requirement is to disable the button when the unselects all the option in the multi combo. How can I achieve this in JS. I am trying to check the selected items on Multicombo's select and deselect listeners. But I am not being able to get the values. What property should I check to get the selected or deselected items.

     <ext:MultiCombo ID="mltcmbWaterlineUnfunded" runat="server" LabelAlign="Left"
                                                                                                DisplayField="Name"
                                                                                                EmptyText="<%$ Resources:WebResource,WaterMark_Select%>" Resizable="false" Width="150">
                                                                                                <Items>
                                                                                                    <ext:ListItem Text="Above" Value="1" />
                                                                                                    <ext:ListItem Text="Below" Value="2" />
                                                                                                    <ext:ListItem Text="Closed" Value="3" />
                                                                                                </Items>
                                                                                                <SelectedItems>
                                                                                                    <ext:ListItem Text="Above" Value="1" />
                                                                                                </SelectedItems>
                                                                                                <Listeners>
                                                                                                   <%-- <Select Handler="CheckForSelections();" />--%>
                                                                                                    <BeforeDeselect  Handler="CheckForSelections();" />
                                                                                                </Listeners>
                                                                                            </ext:MultiCombo>
    Last edited by Daniil; Sep 01, 2015 at 10:26 PM. Reason: [CLOSED]
  2. #2
    Hi arjunrvasisht

    Please view the below markup for the listener

    <Listeners>
        <Change Fn="CheckForSelections" />
    </Listeners>
    And the corresponding JavaScript function

    var CheckForSelections = function (combo, newValues) {
        if (newValues.length == 0)
            //disable button
    }
  3. #3
    HI Enzo, thanks for the reply. It is working fine for the current Multicombo. But I have an extended requirement. Actually i have 4 different multicombos. On change of any of the 4 multicombo's I will have to check all the other multicombo's for the selected items length. How can I achieve that.
  4. #4
    Well, I can use .getSelectedValues() to get the selected items. Thanks for the help EnZo. The thread can be closed :)
    Last edited by Daniil; Sep 01, 2015 at 10:25 PM.

Similar Threads

  1. Replies: 1
    Last Post: Dec 03, 2013, 2:18 AM
  2. [CLOSED] Multicombo created dynamically not showing selected items
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 10, 2013, 11:38 AM
  3. MultiCombo not returning any selected items
    By dtamils in forum 1.x Help
    Replies: 3
    Last Post: Feb 27, 2013, 3:56 AM
  4. Replies: 4
    Last Post: Dec 27, 2011, 3:25 PM
  5. Replies: 0
    Last Post: Sep 19, 2011, 11:11 AM

Tags for this Thread

Posting Permissions