RadComboBox on OnClientItemChecked get sequence

540 Views Asked by At

I actually want to achieve in a multi select checkbox to have a sequence. When i access OnClientItemChecked on RadComboBox i get alert which is working here is the HTML code below.

<telerik:RadComboBox RenderMode="Lightweight" OnClientItemChecked="OnClientItemChecked" ID="cbo_Tag" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Skin="MetroTouch" CssClass="form-control" Width="100%" />

Here is the code for javascript function below

function OnClientItemChecked(sender, eventArgs) {
        var item = eventArgs.get_item();
        console.log(item)
        console.log(sender)
        console.log(eventArgs)
        alert("Checked");
    }

i need to access by sequence when i select in checkbox sequentially one by one it i need to sequence the checkbox in an array with their value. If i use Checkbox All then their sequence should be from top to bottom how can i achieve so.Here is a image e.g. Sequence to add in array

1

There are 1 best solutions below

4
IceCode On

You can try the following:

<script type="text/javascript">

    var checkItems = []

    function OnClientItemChecked(sender, eventArgs) {

        var checkItems = eventArgs.get_checkedItems();

    }
</script>

Whenever you click on a unchecked checkbox the checkBox id will be added to the checkBoxIds array.