I am currently trying to upgrade my javascript libraries to the latest verion and I am getting an error which baffles me.
The application is MVC4 using our own custom model. It consists of a parent form which calls a fairly complex jquery dialog comprised of several partial views.
One of the partial views starts as empty so I populate its div with a div containing a string. I then call a back end search and after the post has completed I populate the filter using $('#GetSeriesDialogGrid').igGridFiltering("filter", searchDef.getFilterExp());. I get an error telling me the igGridFiltering has not been initialized.
I have a similar issue when, after the grid has populated in the iggridselectionrowselectionchanging event I capture the selected rows for an internal variable. I have fixed this by changing the code to use $("#GetSeriesDialogGrid").igGrid("selectedRows") but when I use the igGridSelection version I get an error that igGridSelection is not initialized.
All the events are set up in the ready code of the main dialog form. The script libraries are loaded in the parent form.
Everything is fine when the scripts are as follows
<script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
but fail when changed to
<script src="../../Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
Hello Izac,
The Grid MVC helper generates a main target element of type table as well as js code for the actual initialization of the igGrid widget.
For example the following MVC code:
@(Html.Infragistics()
.Grid(Model)
.ID("Grid")
…
Would generate:
<table id=’Grid’ …> </table>
$('#Grid').igGrid({ … });
Post grid initialization it is possible for the target element to be wrapped in a div (for example if the initialized grid is scrollable), however the target element always remains the same (always the original table with the specified id).
So you shouldn’t have any issues with the calling API methods on the main grid element: $(“#Grid”).
Let me know if you have any additional questions or concerns.
Regards,
Maya Kirova