I am sending a list to my view through Json.
MyCalendar Class
public MyCalendar()
{
public DateTime Date {get; set;}
public string Expense{ get; set;}
public int Days{get;set;}
}
public List<MyCalendar> GetUserInfo()
{
return myCalendar.ToList();
}
[Authorize]
public ActionResult GetMyCalendar()
{
return new JsonResult
{
Data = new MyCalendar().GetUserInfo(),
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
However, I am having difficulty to display them in my grid. The values sent as json are as follows:
I want to display them as follows:
Can I have the code in javascript how I can dothe above please.
<script id="dataTemplate" type="text/x-jquery-tmpl">
<tr>
<td>${FormatJSONDate(Date, "yyyy/MM/dd")}</td>
<td>${Expense}</td>
<td>${Days}</td>
</tr>
</script>