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:
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: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 ); }); } } }); });
$('#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?


Reply With Quote
