Turn multiselect on and off in javascript?

QuestionsTurn multiselect on and off in javascript?
Glenn asked 5 years ago

Hi Abu,

When I click a button that calls jscript what is the call to turn multiselect on or off?

Thanks
Glenn

2 Answers
Abu Ghufran answered 5 years ago

There is no built-in function to do this. However, you can toggle the checkbox of multiselect using jquery code.

Use this code. This will toggle column display and selection function as well.

<input type=”button” value=”Multiselect” onclick=”toggle_multiselect()”>

<script>
function toggle_multiselect()
{
if ($(‘#list1 .cbox:visible’).length > 0)
{
$(‘#list1’).jqGrid(‘hideCol’, ‘cb’);
jQuery(‘.jqgrow’).click(function(){ jQuery(‘#list1’).jqGrid(‘resetSelection’); this.checked = true; });
}
else
{
$(‘#list1’).jqGrid(‘showCol’, ‘cb’);
jQuery(‘.jqgrow’).unbind(‘click’);
}
}
</script>

Glenn answered 5 years ago

Thanks Abu,

Regards,
Glenn

Your Answer

11 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?