mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
cloudstack UI - advanced search - introduce new property "advSearchFields" to lsitViewData.
This commit is contained in:
parent
d1bc54fc84
commit
45360b7a57
@ -49,6 +49,32 @@
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
|
advSearchFields: {
|
||||||
|
name: { label: 'Name' },
|
||||||
|
zoneid: {
|
||||||
|
label: 'Zone',
|
||||||
|
select: function(args) {
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('listZones'),
|
||||||
|
data: {
|
||||||
|
listAll: true
|
||||||
|
},
|
||||||
|
success: function(json) {
|
||||||
|
var zones = json.listzonesresponse.zone;
|
||||||
|
|
||||||
|
args.response.success({
|
||||||
|
data: $.map(zones, function(zone) {
|
||||||
|
return {
|
||||||
|
id: zone.id,
|
||||||
|
description: zone.name
|
||||||
|
};
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// List view actions
|
// List view actions
|
||||||
actions: {
|
actions: {
|
||||||
@ -274,6 +300,7 @@
|
|||||||
if(args.filterBy != null) {
|
if(args.filterBy != null) {
|
||||||
if(args.filterBy.advSearch != null && typeof(args.filterBy.advSearch) == "object") {
|
if(args.filterBy.advSearch != null && typeof(args.filterBy.advSearch) == "object") {
|
||||||
for(var key in args.filterBy.advSearch) {
|
for(var key in args.filterBy.advSearch) {
|
||||||
|
if(args.filterBy.advSearch[key] != null && args.filterBy.advSearch[key].length > 0)
|
||||||
array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
|
array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1394,9 +1394,7 @@
|
|||||||
cloudStack.dialog.createForm({
|
cloudStack.dialog.createForm({
|
||||||
form: {
|
form: {
|
||||||
title: 'Advanced Search',
|
title: 'Advanced Search',
|
||||||
fields: {
|
fields: listViewData.advSearchFields
|
||||||
name: { label: 'Name' }
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
after: function(args) {
|
after: function(args) {
|
||||||
advancedSearch(args);
|
advancedSearch(args);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user