mirror of https://github.com/apache/cloudstack.git
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:
parent
db6c8f0176
commit
53072af8f7
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue