This project is read-only.

css & grid events not working after ajax call

Jul 9, 2014 at 7:43 PM
Edited Jul 10, 2014 at 4:32 PM
Hi Guys,

I am able to dynamically update the grid using an ajax call without reloading the page but after the reload the grid loses the ability to filter, select rows, highlights etc. Only the data is refreshed
 jQuery.ajax({
                type: "POST",
                url: "@Url.Action("Convert", "Home")",
                data: { book: JSON.stringify(book) },
                success: function (response) {                        

                    $("#dataGrid").html(response);

                    //Tried adding the line below, but no difference
                     $(".grid-mvc").gridmvc(); 

                },
                error: function (errorThrown) {
                    console.log(errorThrown);
                }
            });
the html body ias as follows
    <div id="dataGrid">
          @Html.Partial("_GridView")
    </div>

In the controller I am returning the PartialView which contains the grid
 public ActionResult Convert(string book)
 {
   //My code to fetch book data & populate booksList

   return PartialView("_GridView",booksList);
 }  
What am I doing wrong here, any help would be appreciated

Regards
Jul 28, 2014 at 5:05 AM
Hi,

It seems to be ok. Are you have any errors in browser console?