Grid not populating when using POST transport

2 posts, 0 answers
  1. Eric
    Eric avatar
    1 posts
    Member since:
    Dec 2014

    Posted 30 Dec 2014 Link to this post


    I have been using the Grid php wrapper for a few days in a new web project. Most of it work fine, except one thing, to which I can't find the solution.

    I followed the examples to set up a simple Grid using remote data, formatted as JSON, through a crud.php file. The problem is that when I use POST transport type to read data, the Grid won't show anything (even though my crud.php file returns a correct JSON result). The Grid works fine if I don't use POST to read data. However, create, update and destroy commands work fine with POST.

    Here is the code :
    $read = new \Kendo\Data\DataSourceTransportRead();
        ->type('POST');  // If I remove this line, the Grid works, otherwise it's empty
    // [...create, update, destroy use POST type...]
    $transport = new \Kendo\Data\DataSourceTransport();
        ->parameterMap('function mapParamsToJSON (data){return kendo.stringify(data);}');

    The JSON data is just like this :

    I could use my Grid with GET, but for obvious security reasons I'd rather not.

    Any idea would be greatly appreciated.
  2. T. Tsonev
    T. Tsonev avatar
    2834 posts

    Posted 01 Jan 2015 Link to this post


    The Grid doesn't do a lot with the request type setting beside forwarding it to $.ajax.
    You can try requesting the data directly to exclude the grid out of the loop.

    For example, using the browser console:
      url: "users.crud.php?do=read",
      type: "POST",
      contentType: "application/json"
    }).done(function(data) {
    }).fail(function(xhr, status) {
      console.log("Error: " + status);

    If reading the data this way works then we can move forward to debug any issues with the widget itself.

    Happy New Year, wishing you a productive 2015!

    T. Tsonev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top