Please help what i want i SHOULD BE IN POSITION TO EDIT the Names field just in case i want to change the Name in field Name and edit the House Field and then Make Admno and ACNOS Read only Fields
Note Class, Stream, STDTYPE should appear as ComboBoxes which have values to be selected from the list
@Code
Layout = Nothing
End Code
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div style="width: 500px">
<table id="tblCustomers" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse">
<thead>
<tr>
<th>ADMNO</th>
<th>NAME</th>
<th>CLASS</th>
<th>STREAM</th>
<th>HOUSE</th>
<th>STDTYPE</th>
<th>ACNOS</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css" />
<script type="text/javascript">
$(function () {
$.ajax({
type: "POST",
url:"/StudentList/AjaxMethod",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
});
function OnSuccess(response) {
$("#tblCustomers").DataTable({
bLengthChange: true,
lengthMenu: [[5, 10, -1], [5, 10, "All"]],
bFilter: true,
bSort: true,
bPaginate: true,
data: response,
columns: [
{ 'data': 'ADMNO' },
{ 'data': 'NAME' },
{ 'data': 'CLASS' },
{ 'data': 'STREAM' },
{ 'data': 'HOUSE' },
{ 'data': 'STDTYPE' },
{ 'data': 'ACNOS' }]
});
};
</script>
</body>
</html>
Public Class StudentListController
Inherits Controller
' GET: Home
Public Function Index() As ActionResult
Return View()
End Function
Public Function Index2() As ActionResult
Return View()
End Function
<HttpPost>
Public Function AjaxMethod() As JsonResult
Dim entities As New STOREEntities
Dim customers As List(Of STUDENT) = (From customer In entities.STUDENTs).ToList()
Return Json(customers)
End Function
End Class
How about editing the specific colums in the data table.