joeharrison714 / MVCGrid.Net

http://mvcgrid.net
MIT License
75 stars 56 forks source link

How to fire data-mvcgrid-apply-filter{event} with dynamically loaded grid? #160

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi.

I am using the MVCGrid for lookups. When my lookup input need to show the grid, on ajax call is made to the backed to return the PartialView containing the grid (in this partial view I have an razor statement like @Html.MVCGrid("GridAAA"). Above the grid I have some input to act as filters and one button containing "data-mvcgrid-apply-filter="click" to fireup the filter. The search/filter event is not firing.

I assume tha this could be a lifecycle issue vs. the hook of data-mvcgrid-apply-filter with the filtering action, that seems to happen in document ready/load only.

How can I use filtering in dynamically loaded grids, via ajax calls?

PS.: The same problem occurs with pagging too...