how can i make multiple selection only active when checked the checkbox only

Questionshow can i make multiple selection only active when checked the checkbox only
Norman asked 10 years ago

Hi,

as the subject stated. how can i do that?
i want the user is able to click one row only that being highlighted.
while when the user want to delete multiple record. then he can checked the checkbox only?

thx

2 Answers
Abu Ghufran answered 10 years ago

Pasting from FAQs.

Q) How to make single row selection, keeping multiselect option?

Following code will enable single selection, in multiselect mode.

PHP code config:

$e["js_on_load_complete"] = "do_onload";
$g->set_events($e);

JS code config:

<script>
function do_onload()
{
jQuery(".jqgrow").click(function(){ jQuery("#list1").jqGrid('resetSelection'); this.checked = true; });
}
</script>

Sergey answered 10 years ago

This work nice, you can make multiple select when Ctrl-Key is pressed… otherwise only one row can be selected…

function do_onload() {
jQuery(".jqgrow").click(function (event) {
if(!event.ctrlKey)
{
jQuery("#list1").jqGrid('resetSelection');
this.checked = true;
}
});
}

Your Answer

7 + 18 =

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?