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
This commit is contained in:
Brian Federle 2012-11-01 12:17:09 -07:00
parent db6c8f0176
commit 53072af8f7
2 changed files with 14 additions and 6 deletions

View File

@ -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) {

View File

@ -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;
});