From 0c84ca37a4718436afa32a1bba0f03fbaccd4580 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jan 2012 15:47:33 -0800 Subject: [PATCH] cloudstack 3.0 new UI - security group page - implement search. --- ui/scripts/network.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index e99a1d08b46..49b3721b3ab 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1969,11 +1969,22 @@ } } }, - - //dataProvider: testData.dataProvider.listView('securityGroups'), - dataProvider: function(args) { + + dataProvider: function(args) { + var array1 = []; + if(args.filterBy != null) { + 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) + array1.push("&keyword=" + args.filterBy.search.value); + break; + } + } + } + $.ajax({ - url: createURL("listSecurityGroups&page="+args.page+"&pagesize="+pageSize), + url: createURL("listSecurityGroups&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), dataType: "json", async: true, success: function(json) { @@ -2000,8 +2011,7 @@ account: { label: 'Account' } } ], - - //dataProvider: testData.dataProvider.detailView('securityGroups') + dataProvider: function(args) { $.ajax({ url: createURL("listSecurityGroups&id="+args.id),