cloudstack UI - advanced search - extend listView widget to pass data on Advanced Search Dialog to data provider.

This commit is contained in:
Jessica Wang 2012-09-26 11:02:45 -07:00
parent ef48250bd9
commit d09b46751c
2 changed files with 9 additions and 7 deletions

View File

@ -271,8 +271,13 @@
dataProvider: function(args) {
var array1 = [];
if(args.filterBy != null) {
if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
if(args.filterBy != null) {
if(args.filterBy.advSearch != null && typeof(args.filterBy.advSearch) == "object") {
for(var key in args.filterBy.advSearch) {
array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
}
}
else if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
switch(args.filterBy.search.by) {
case "name":
if(args.filterBy.search.value.length > 0)

View File

@ -1368,7 +1368,7 @@
//advanced search
var advancedSearch = function(args) {
page = 1;
page = 1;
loadBody(
$table,
listViewData.dataProvider,
@ -1379,10 +1379,7 @@
page: page,
filterBy: {
kind: $listView.find('select[id=filterBy]').val(),
search: {
value: args.data.name,
by: 'name'
}
advSearch: args.data
}
},
listViewData.actions,