mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +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: {
|
||||||
@ -270,11 +296,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var array1 = [];
|
var array1 = [];
|
||||||
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) {
|
||||||
array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
|
if(args.filterBy.advSearch[key] != null && args.filterBy.advSearch[key].length > 0)
|
||||||
|
array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
|
else if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
|
||||||
|
|||||||
@ -1390,13 +1390,11 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
$listView.find('.button.search#advanced_search').bind('click', function(event) {
|
$listView.find('.button.search#advanced_search').bind('click', function(event) {
|
||||||
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