Grid not loading with second query

2 posts, 0 answers
  1. Christopher
    Christopher avatar
    2 posts
    Member since:
    Apr 2017

    Posted 05 May Link to this post

    I have a grid that I am loading with a linq query to my database.  On page load it works great and returns dated now + 21 days.  The users need to ability to then enter there own dates to search between.  It is all working great right up to the point the data returned from the controller needs to get into the grid.  It just won't load.

    Relevent code of grid

    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read
            .Action("Action", "Controller")
            )
        .Sort(sort =>
        {
            sort.Add(p => p.ID).Ascending();
            sort.Add(p => p.Date).Ascending();
        })
        .Group(g =>
        {
            g.Add(c => c.ID);
        })
        .ServerOperation(false)
    )

     

    When the user enters 2 dates and clicks search the function is run.  The grid is cleared and a loading message appears goes away and the grid remains blank.

    function onClickSearch() {
        var fromDate = $("#startDate").data("kendoDatePicker").value(),
            toDate = $("#endDate").data("kendoDatePicker").value();
        $("#prodReadiGrid").data("kendoGrid").dataSource.read({ "start": fromDate, "end": toDate});
    }

     

    When I debug I see the controller sending the view the grid, it just does not load.

     

    Any ideas?

  2. Georgi
    Admin
    Georgi avatar
    148 posts

    Posted 09 May Link to this post

    Hello Christopher,

    I apologize for the late reply.

    I used the configuration from your post and assembled a small sample. You can find it attached.

    The sample is working as expected on my end and the data in the Grid is retrieved as expected. Please give the sample a try and let me know how it works for you. 

    I would appreciate it if you can modify the sample in a way that the issue you are observing is replicated and send it back to us. This will enable us to examine the behavior locally and look for its cause.


    Regards,
    Georgi
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top