I have a jqGrid and I want one column to be a multiselect combobox. I got a plugin from,
http://www.abeautifulsite.net/blog/2008/04/jquery-multiselect/
How to integrate those, and how to get the selected values?
I have a jqGrid and I want one column to be a multiselect combobox. I got a plugin from,
http://www.abeautifulsite.net/blog/2008/04/jquery-multiselect/
How to integrate those, and how to get the selected values?
You can use jQuery UI MultiSelect Widget for example to implement multiselect with checkboxes.
The demo shows how you can implement this. You will have the results like the following
You can customize multiselect plugin using different options. In the demo I used the following code
edittype: 'select', editoptions: {
value: 'FE:FedEx;TN:TNT;IN:Intim',
dataInit: function (elem) {
setTimeout(function () {
$(elem).multiselect({
minWidth: 100, //'auto',
height: "auto",
selectedList: 2,
checkAllText: "all",
uncheckAllText: "no",
noneSelectedText: "Any",
open: function () {
var $menu = $(".ui-multiselect-menu:visible");
$menu.width("auto");
return;
}
});
}, 50);
},
multiple: true,
defaultValue: 'IN'
}
I should mention that you can edit multiple selectable list without using any plugins. The only disadvantage is that the user interface will be not so nice. The next demo shows how all works without multiselect plugin.
UPDATED: If you need to set all rows in editing mode directly after the loading you can do this like in the next demo.
editRow
in the loop for all rows of the grid inside of loadComplete
. It will start the inline editing. I have to mention that I know no practical case where you have Database and you can be sure that nobody else will be able to edit the database data. If you have database then more as one user can modify the data. If you open web page you can go away and come back to finish modification of old data and overwrite more recent data. If you directly save the row after the modification it works very quickly and the problem will be not so hard. –
Chu sopt
in searchoptions
option. If you need to set select options dynamically you can use dataUrl
property instead of value
property of editoptions
. –
Chu © 2022 - 2024 — McMap. All rights reserved.
dataInit
but it could be different small things which need be done for example to have correct width and height of the control. Such "small" things can be different in every editing mode. – Chu