Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have fixed the problem.</p> <p>Here's the script code:</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; $(function() { var data = new kendo.data.HierarchicalDataSource({ transport: { read: { url: "../api/notifications/byuserid/10078261", contentType: "application/json" } }, schema: { model: { children: "notifications" } } }); $("#treeview").kendoTreeView({ dataSource: data, checkboxes: { checkChildren: true }, dataTextField: ["notificationType", "NotificationDesc"] }); }); &lt;/script&gt; </code></pre> <p>And here's the API:</p> <pre><code>namespace X.Controllers { public class NotificationsController : ApiController { public List&lt;Node&gt; getNotifications(int id) { var bo = new HomeBO(); var list = bo.GetNotificationsForUser(id); var notificationTreeNodes = (from GBLNotifications n in list where n.NotificationCount != 0 select new NotificationTreeNode(n)).ToList(); var li = notificationTreeNodes.Select(no =&gt; new Node { notificationType = no.NotificationNode.NotificationType + " " + "(" + no.NotificationNode.NotificationCount + ")", notifications = bo.GetNotificationsForUser(id, no.NotificationNode.NotificationTypeId).Cast&lt;GBLNotifications&gt;().Select(item =&gt; new Notification { ID = item.NotificationId, NotificationDesc = item.NotificationDescription }).ToList() }).ToList(); return li; } } public class Node { public List&lt;Notification&gt; notifications; public string notificationType { get; set; } } public class Notification { public int ID { get; set; } public string NotificationDesc { get; set; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload