I have problems with the bootstrap datatable plugin My class looks something like this:
Model
public class Class1 {
public string EmployeeID { get; set; }
public string FirstName { get; set; }
public Position Position { get; set; }
public Class1 GetEmployees()
{
return this;
}
}
public class Position {
public string PositionID { get; set; }
public string PositionName { get; set; }
//Other functions below
}
Controller
public JsonResult GetEmployees()
{
return Json(new Class1().GetEmployees(), JsonRequestBehavior.AllowGet);
}
HTML
<table id="tblLeaveCredits"
data-url="/Employees/GetEmployees"
data-toggle="table"
data-search="true"
data-click-to-select="true"
data-select-item-name="rdoSelectedItem"
data-cache="false">
<thead>
<tr>
<th data-field="state" data-radio="true"></th>
<th data-field="FirstName" data-sortable="true">Description</th>
<th data-field="Position.PositionName" data-sortable="true">Available</th>
</tr>
</thead>
</table>
My question is, how can i get the data of the Position class from the Json return and display it as field in the datatable?