How to split the DataSource JSON response

2 posts, 1 answers
  1. Gary
    Gary avatar
    62 posts
    Member since:
    Sep 2013

    Posted 14 Feb 2012 Link to this post

    I am presently returning dataType 'json' in a kendo DataSource that is assigned to a grid.

    I would also like to display the total number of rows returned. Therefore, I modified my JSON result to include this information in the result, and I have assigned the data being returned to a rows property:

        { count: 99, rows: { ... } }

    I need help with two things:

    1. How do I associate the kendo Grid dataSource to the rows property of the JSON result?
    2. How can I retrieve the count property from the dataSource result?

  2. Answer
    William avatar
    23 posts
    Member since:
    Jan 2012

    Posted 14 Feb 2012 Link to this post

    Here is how I do both items.  First, I use the schema configuration object and set the result count, through "total."  Next, I use the dataSource configuration and set it to the variable I created called "dataSource" (yes, very original).  Hope this helps. 


    var dataSource = new{  
        transport: {
         read: {
          url: "/app/handlers/blah.ashx",
          dataType: "json",
          data: {}
        schema: {
        columns: [
Back to Top