When i edit a Jquery Datatable , where there is a column which i created by selecting from list and on time of editing also i need to display list for instance say dropdownlist with values in it so i can choose and press enter .
So how i can bind a dropdown in place of textbox which is coming by default ?
My code :
<script type="text/javascript">
$(document).ready(function () {
$('#myDataTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
//"bServerSide": true,
"aoColumns": [
{
"sName": "Lead_Id",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
return '<a href=\"Home\\LeadWizardView\\' + oObj.aData[0] + '\">To Wizard</a>';
}
},
{ "sName": "Contact_Name" },
{ "sName": "Contact_Address" },
{ "sName": "Lead_Source" }, //HERE lead-source should be a dropdown in datatable and data should be filled from DB into dropdownlist
{ "sName": "Domain" }
]
}).makeEditable({
sUpdateURL: "/Home/UpdateData",
sAddURL: "/Home/AddData",
sDeleteURL: "/Home/DeleteData",
});
</script>
}
<div id="demo">
<table id="myDataTable" class="display">
<thead>
<tr>
<th>Details</th>
<th>Contact Person</th>
<th>Contact Address</th>
<th>Lead Source</th>
<th>Domain</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Lead_complete_list)
{
<tr id="@item.Lead_Id">
<td >@item.Lead_Id</td>
<td>@item.Contact_Name</td>
<td>@item.Contact_Address</td>
<td>@item.Lead_Source</td>
<td>@item.Domain</td>
</tr>
}
</tbody>
</table>
Regards