-
Dec 21st, 2011, 03:45 PM
#1
Thread Starter
Hyperactive Member
[ABANDON] Calling jQuery Plugin Add Method
I'm having a problem calling a jQuery plugin to add elements.
Please check the "add" method of this plugin: http://revaxarts-themes.com/whitelab...ml#multiselect
In my code I have a jQuery Ajax call which will bring back a json result (collection of "employee" objects)
The data comes back fine, and I can add employees to my list as follows:
Code:
// Load all employees in selected team
$("select#TeamId").change(function () {
allAgentsList.empty();
var teamId = $("select#TeamId > option:selected").attr("value");
$.ajax({
type: "POST",
url: urlGetTeamEmployees,
data: { teamId: teamId },
success: function (returndata) {
if (returndata.data.length > 0) {
$.each(returndata.data, function (index, itemData) {
var id = itemData.Id;
var name = itemData.FirstName + ' ' + itemData.LastName;
$('#SelectedAgents').wl_Multiselect('add', name );
});
}
}
});
});
However, I want to add the items with it's Id and Name (above just use name) and I used many variations of the add method (as per that link) without luck, such as:
$('#SelectedAgents').wl_Multiselect('add', { id : name } ); etc (the documentation strangely are quite how to add a single item at a time, passing both value and text.
Any idea?
Last edited by Krokonoster; Dec 22nd, 2011 at 03:31 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|