Hello Deepa,
I have tried the sample you send and it works fine. However I am still getting the same error on my application.
I am not getting any javascript error during drag and drop.
Below is my ajax call to :
function UpdateExclusionInclusion() {
$.ajax({
url: '/Services/GetInclusionsExclusions'
type: "POST",
async: true,
success: function (data) {
$("#ExclusionInclusionList").html(data);
return true;
},
error: function (xhr) {
alert("An error occurred while getting list of inclusions and exclusions");
return false;
}
});
}
My controller action:
public ActionResult GetInclusionsExclusions ()
{
InclusionsExclusionsViewModel inclusionsExclusionsViewModel = GetInclusionsExclusionsViewModel(;
return PartialView("~/Views/Shared/Partials/InclusionsExclusions/_InclusionsExlusions.cshtml", inclusionsExclusionsViewModel);
}
The partial view as is:
@model WebMVC.ViewModels.Service.InclusionsExclusionsViewModel
<div class="form__section form__section--bg mdl-shadow--2dp mb-30 p-20">
<div class="form__section-col form__section-col--lg">
<div class="tree-view">
<div class="tree-view__col">
<div class="tree-view__toolbar">
<h4 class="tree-view__title">Inclusions</h4>
</div>
@Html.EJ().ListBox("Inclusions").Width("100%").Datasource((IEnumerable<object>)Model.Inclusions).ListBoxFields(incl => incl.Text("Label").ID("TypeOfInclusionId")).AllowDrag(true).AllowDrop(true).Enabled(true).EnablePersistence(true)
</div>
<div class="tree-view__control">
<i class="icon-chevron-left"></i>
<i class="icon-chevron-right"></i>
</div>
<div class="tree-view__col">
<div class="tree-view__toolbar">
<h4 class="tree-view__title">Exclusions</h4>
</div>
@Html.EJ().ListBox("Exclusions").Width("100%").Datasource((IEnumerable<object>)Model.Exclusions).ListBoxFields(excl => excl.Text("Label").ID("TypeOfInclusionId")).AllowDrag(true).AllowDrop(true).Enabled(true).EnablePersistence(true)
</div>
</div>
</div>
</div>
@Html.EJ().ScriptManager()
Whenever I have at least one value in one of the ListBox, it is working. It does not allow drop when the listbox is empty.