Hello support team,
I have a situation where I'm displaying a page with several search options. One of them is an igcombo. When this page loads, I call Loader() to bring in all of the necessary files for the igcombo.
Once the user submits the search form, an ajax call is made, and a partial view is rendered with the results in an iggrid. In the partial view, I also call Loader() so that it can bring in the files necessary for the iggrid.
However, when the grid loads, I get a javascript error: Line: 28Error: Unable to get property '_injectGrid' of undefined or null reference
If I don't use the igcombo in the initial page load, this error won't occur. Is there some way I can tell the loader that I need both the combo and the grid files, even though when the page first loads there is no grid to display?
Edit: I've been playing a little more with the editable feature of the grid, and I've come across another problem related to the loader:
http://www.igniteui.com/grid/basic-editing
When my grid loads, I get an error message: Object doesn't support property or method 'igButton' (I copied the html for the 'Save Changes' and 'Undo' buttons from the sample).
My code is a little different than the sample. The sample uses the jQuery document.ready shortcut to assign all of the handlers. I can't do that because I'm loading the grid inside of a partial view, so I wrapped all of that sample code in a function called applyEditable() and then called that function in the OnSuccess method of my ajax call which renders the grid.
When I check the page in the browser's debugger, the Loader() method doesn't seem to be loading the lob javascript file, which I believe contains the definition of igButton (if I'm reading the sample correctly).
So, now I'm a little more confused about how to use the loader. I'm calling the Loader once when the search options view renders, and then once again in the view that renders the grid. In each case, the loader is at the top of the file, before any html is rendered. Am I doing something wrong?
Thank you very much! These are fun controls - I just feel like my inexperience with web development gets in my way sometimes.
Hello Kyle,
Thank you for posting in our community!
We received your support request concerning using igGrid with igCombo at the same page, and this case has been assigned to me. I have attached two samples representing how igGrid and igCombo could be implemented in the same page. The first sample uses the loader and the second sample is an MVC and uses the MVC wrapper.
Hope this helps. If you have any additional question feel free to update the case. In order to investigate further I will need a sample reproducing the issue you have encountered.
Looking forwards to your reply.
The MVC sample.
Thank you for your answer.
I have tried to reproduce the issue but since I have encountered other issues would you send me the whole package? In order to decrease the size please remove the packages folder, the bin and the obj folders. You might to use the following email to upload it: support@infragistics.com
Please add my name in the subject field if you decide to use the email.
Thank you in advance.
Looking forwards to hearing from you.
Thanks Dimka,
I removed the folders, and now it's only about 6MB, so I'll just try to upload it here.
Thanks again!
I have managed to investigate this further. I have made several modifications:
The model is referred both in Index.cshtml and _GridPartial.cshtml
The scripts re loaded in the Index.cshtml page by the following code snippet:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://cdn-na.infragistics.com/jquery/20131/latest/js/infragistics.loader.js"></script>
@(Html.Infragistics().Loader()
.ScriptPath("http://cdn-na.infragistics.com/jquery/20131/latest/js/")
.CssPath("http://cdn-na.infragistics.com/jquery/20131/latest/css/")
.Resources("igHierarchicalGrid.*")
.Render()
)
Attached is the modified version of the sample for your reference.
If any further questions arise feel free to contact me again.
Thanks Dimka! I will try these changes as soon as I can and let you know how it works.
I am just following up what your progress is on this scenario. If you need any further assistance please let me know.