From 3d233d42fca44e5ef8ee5f94d24d427b07937e7b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jan 2012 15:03:05 -0800 Subject: [PATCH] cloudstack 3.0 new UI - zone page - implement search. --- ui/scripts/system.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 46b213a2d66..196ce29d3eb 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -3207,9 +3207,21 @@ }, - 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("listZones&page=" + args.page + "&pagesize=" + pageSize), + url: createURL("listZones&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), dataType: "json", async: true, success: function(json) {