Note that there are some explanatory texts on larger screens.

plurals
  1. POKendo Grid just refuses to display my data
    primarykey
    data
    text
    <p>This is really frustrating me. I feel like I'm doing everything right but my grid just won't display anything. I KNOW I'm sending back the data correctly, because I can see it in Fiddler, and it's the exact same format as one of my example which works.</p> <p>Data from Fiddler looks like this (JSON, as expected, with the "d", but there's 200 objects in the array, here I only show one.)</p> <pre><code>{"d": [{"__type":"DisputeProjectManagerModel.DISP_PROJECT_NAME_MASTER", "PROJECT_ID_NUMBER":241, "PROJECT_NAME":"AT\u0026T Settlement - Stake date payment", "CATEGORY":null, "CONTRIBUTION":"N", "WIN_RATE":"N", "SETTLEMENT":"N", "DESCRIPTION":null, "JUSTIFICATION":null, "ACTIVE":"N", "MODIFIED_USER":"SYSTEM", "MODIFIED_DATE":"\/Date(1377744633000)\/", "EntityState":2, "EntityKey":{"EntitySetName":"DISP_PROJECT_NAME_MASTER","EntityContainerName":"DisputeProjectManagerEntities","EntityKeyValues":[{"Key":"PROJECT_ID_NUMBER","Value":241}], "IsTemporary":false} }] } </code></pre> <p>Here's the code for my grid. This is about the 50th version I've tried.</p> <pre><code>$(document).ready(function () { setupGrid(); }); function setupGrid() { alert("click OK to make Ajax call"); $("#projectManagerGrid").kendoGrid({ columns: ["PROJECT_ID_NUMBER", "PROJECT_NAME", "CATEGORY", "CONTRIBUTION", "WIN_RATE", "SETTLEMENT", "DESCRIPTION", "JUSTIFICATION", "ACTIVE", "MODIFIED_USER", "MODIFIED_DATE"], dataSource: { type: "odata", transport: { read: { type: "POST", url: "/special_pages/DisputeProjectManager.aspx/getProjects", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { alert('WORKED!'); }, error: function (xhr, textStatus, errorThrown) { handleAjaxError(xhr, textStatus, errorThrown); } }, parameterMap: function (data, type) { return kendo.stringify(data); } } }, schema: { data: "d", columns: ["PROJECT_ID_NUMBER", "PROJECT_NAME", "CATEGORY", "CONTRIBUTION", "WIN_RATE", "SETTLEMENT", "DESCRIPTION", "JUSTIFICATION", "ACTIVE", "MODIFIED_USER", "MODIFIED_DATE"], model: { id: "PROJECT_ID_NUMBER", fields: { "PROJECT_ID_NUMBER": { type: "number", editable: false }, "PROJECT_NAME": { type: "string", editable: true }, "CATEGORY": { type: "string", editable: true }, "CONTRIBUTION": { type: "string", editable: true }, "WIN_RATE": { type: "string", editable: true }, "SETTLEMENT": { type: "string", editable: true }, "DESCRIPTION": { type: "string", editable: true }, "JUSTIFICATION": { type: "string", editable: true }, "ACTIVE": { type: "string", editable: true }, "MODIFIED_USER": { type: "string", editable: false }, "MODIFIED_DATE": { type: "date", editable: false } } } }, editable: { update: true, create: true, destroy: false }, toolbar: ["create", "save", "cancel"] }); } </code></pre> <p>Here's my page method, this works fine:</p> <pre><code>[WebMethod] public static List&lt;DISP_PROJECT_NAME_MASTER&gt; getProjects() { try { using (DisputeProjectManagerEntities ctx = new DisputeProjectManagerEntities()) { var q = (from e in ctx.DISP_PROJECT_NAME_MASTER orderby e.MODIFIED_DATE descending select e); return q.ToList&lt;DISP_PROJECT_NAME_MASTER&gt;(); } } catch { return null; } } </code></pre> <p><em>I'm not just looking for a code fix here. If you can explain what's going on with this, I would really appreciate it</em>. I have spent many hours reading the documentation and I suspect this has something to do with my model and schema being wrong, but the docs about those fields just don't have enough detail.</p> <p>One really weird thing is, when I run the Ajax call, neither callback function runs. You can see I have a callback for both error and success - neither of those runs. I can see the Ajax call being made and the data coming back. I would expect one or the other of those functions to run - I mean, it has to be either success or error, right?</p>
    singulars
    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. 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