Updated Branches: refs/heads/master db6c8f017 -> 53072af8f
CS-16295: Fix select project search box Adds search functionality to 'select project' dialog's input box, which was not sending value to the listProjects API Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/53072af8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/53072af8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/53072af8 Branch: refs/heads/master Commit: 53072af8f79dd42809877c300cf18644d3d0fdae Parents: db6c8f0 Author: Brian Federle <[email protected]> Authored: Thu Nov 1 12:17:09 2012 -0700 Committer: Brian Federle <[email protected]> Committed: Thu Nov 1 12:17:39 2012 -0700 ---------------------------------------------------------------------- ui/scripts/projects.js | 13 +++++++++---- ui/scripts/ui-custom/projects.js | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/53072af8/ui/scripts/projects.js ---------------------------------------------------------------------- diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 34c57c6..8310ecf 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -569,13 +569,18 @@ // Project listing data provider dataProvider: function(args) { var user = args.context.users[0]; + var data = { + accountId: user.userid, + listAll: true + }; + + if (args.projectName) { + data.keyword = args.projectName; + } $.ajax({ url: createURL('listProjects', { ignoreProject: true }), - data: { - accountId: user.userid, - listAll: true - }, + data: data, dataType: 'json', async: true, success: function(data) { http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/53072af8/ui/scripts/ui-custom/projects.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/projects.js b/ui/scripts/ui-custom/projects.js index 221d834..117c433 100644 --- a/ui/scripts/ui-custom/projects.js +++ b/ui/scripts/ui-custom/projects.js @@ -543,8 +543,9 @@ var $cancel = $('<div>').addClass('button cancel').html(_l('label.cancel')); // Get project data - var loadData = function(complete) { + var loadData = function(complete, options) { cloudStack.projects.dataProvider({ + projectName: options ? options.projectName : null, context: cloudStack.context, response: { success: function(args) { @@ -585,7 +586,9 @@ // Search form $searchForm.submit(function() { $list.find('li').remove(); - loadData(); + loadData(null, { + projectName: $(this).find('input[type=text]').val() + }); return false; });
