Hi!
Let's say I have 4 ListBoxes - First one is the source, the other ones are for associated roles of the user. I'd like to be able to drag and drop the user to multiple ListBoxes instead of moving him around.
Is there a way to achieve this?
[script]
function itemdrop(args) {
var data = args.droppedItemText;
var obj = $('#selectskills').ejListBox("instance");
obj.addItem(data, index); // pass the index position
} |
Hi Selvamani,
exactly what I was looking for. Thanks :)
Hi Selvamani,
unfortunately this didn't work as expected. I'm using JSON as source so I read in the documentation:
listItem | Object |string | This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. |
[script]
function onClick(args) {
var dataSrc = $("#listboxsample1").ejListBox("instance");
var data = JSON.stringify(dataSrc.model.dataSource);
$.ajax({
type: 'POST',
content: "application/json; charset=utf-8",
url: '@Url.Action("sample", "ListBox")',
data: { selectedtext: data },// send to server as stringified data
success: function (response) {
}
});
window.location = 'test';
}
[cs]
public ActionResult sample(string selectedtext)
{
var values = JsonConvert.DeserializeObject(selectedtext); //get the dropped items
List<language> lang = new List<language>();
ViewBag.datasource12 = values;
return View();
} |