mirror of https://github.com/apache/cloudstack.git
List view UI: Support pre-selected checkboxes
In listings with checkbox actions, if _isSelected: true is passed in a data item, then pre-select the checkbox on load.
This commit is contained in:
parent
66a16a1fd3
commit
a589a367d0
|
|
@ -734,6 +734,8 @@
|
|||
var makeActionIcons = function($td, actions, options) {
|
||||
options = options ? options : {};
|
||||
var allowedActions = options.allowedActions;
|
||||
var $tr = $td.closest('tr');
|
||||
var data = $tr && $tr.data('json-obj') ? $tr.data('json-obj') : null;
|
||||
|
||||
$.each(actions, function(actionName, action) {
|
||||
if (actionName == 'add' || action.isHeader)
|
||||
|
|
@ -766,7 +768,9 @@
|
|||
.append(
|
||||
$('<input>').attr({
|
||||
type: 'checkbox',
|
||||
name: actionName
|
||||
name: actionName,
|
||||
checked: data && data._isSelected ?
|
||||
'checked' : false
|
||||
})
|
||||
)
|
||||
.attr({
|
||||
|
|
|
|||
Loading…
Reference in New Issue