We are upgrading the jquery versions to the latest for an ownapplication code.
On upgrading to jquery 3.4.1, the grid is not loading for the machine level application and is failing in infragistics.ui.grid.framework.js with the below error :
0x800a138f - JavaScript runtime error: Unable to get property '_injectGrid' of undefined or null reference
0x800a138f - JavaScript runtime error: Unable to get property 'locale' of undefined or null reference
Following this error, the grid on the page is not loading.
Code snippet- html code
We are upgrading the jquery versions to the latest for the PAMS application code to cover the VAT findings.
HTML CODE :
<div style="clear: both;"> @(Html.Infragistics().Grid<AgentEvent>().ID("eventsGrid") .Width("100%").Caption("Agent Events") .Columns(x => { x.For(y => y.TimeStamp).Width("15%").HeaderText("Date").Format("yyyy-MM-dd HH:mm").DataType("date"); x.For(y => y.EventId).Width("8%").HeaderText("Event ID"); x.For(y => y.Message).Width("auto").HeaderText("Message"); }) .Features(f => { f.Paging().PageSizeDropDownLocation("inpager").PageSize(10); f.Resizing(); }) .DataSourceUrl(Url.Action("AgentEventData", new { id = Model.Agent.Id })) .DataBind().Render())</div>
ERROR : Unable to get property '_injectGrid' of undefined or null reference in nfragistics.ui.grid.framework.js
Could you please help me out on this?
The issue arise when js/jquery is not able to refer to the element. It is because at the time of rendering the page(view), object is null or undefined - which means that there is no instance of a class in the variable. If you are getting data for object from an async call(api's), these kind of problems will arise. So you should always check the object whether it is null or undefined then if it is not, you can access its properties.
The standard way to catch null and undefined simultaneously is this:
if (variable == null) { // your code here. }
Because null == undefined is true, the above code will catch both null and undefined.
Also you can write equivalent to more explicit but less concise:
if (variable === undefined variable === null) { // your code here. }
This should work for any variable that is either undeclared or declared and explicitly set to null or undefined.
In most cases it is related to getElementById(). So getting a value from an input could look like this:
var value = document.getElementById("frm_new_user_request").value
Also you can use some JavaScript framework, e.g. jQuery, which simplifies operations with DOM (Document Object Model) and also hides differences between various browsers from you.
Getting a value from an input using jQuery would look like this:
input with ID "element": var value = $("#element).value input with class "element": var value = $(".element).value
Hi,
Thank you for the response. Is there a way to use jquery.migrate nuget to do this upgrade of the infragistics libraries? Or is there any other way to do it?
Hello Neel,
According to our supported environments topic jQuery version 3.4.x are supported from version 18.1 and later. The latest version that you can use with version 12.2 (which is your current version) is jQuery 1.9.1.
Having this in mind my suggestion would be to upgrade to any of the latest versions of Ignite UI in order to take advantage not only of support for latest versions of different libraries but of plenty new features and functionalities as well. You can contact our sales department at sales@infragistics.com and they would be glad to assist you with teh upgrading process.
More about Infragistics supported environments could be found here.
Please let me know if you need any additional questions.
Hello,
The version is
Infragistics.Web.ClientUI Grid localization resources 12.2.20122.2086
*
Please keep in mind that we are moderating our forums so that it might take some time until you posts passes the moderation and appears in the thread.
Thank you for the snippet provided. It seems that the following lines are referencing scripts that are part of Ignite UI product. I am looking to find out what is the exact version of the following files:
<script src="@Url.Content("~/Scripts/ig/modules/infragistics.util.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/ig/infragistics.loader.js")" type="text/javascript"></script>
Since they seem to be referenced from a folder within your application can you please open the Scripts folder, open one of the infragistics script files (.js), for example the infragistics.util.js, in a text editor. In the beginning of the file there is small piece of metadata looking similar to the following:
/*!@license * Infragistics.Web.ClientUI Util functions 19.2.23 * * Copyright (c) 2011-2019 Infragistics Inc. * * util functions that extend the jQuery namespace * if something is not already available in jQuery, please add it here. * * http://ko.infragistics.com/ * * Depends on: * */
What I need are the numbers since they state what is the version of the scripts. In the provided sample meta data the version of the code is:
19.2.23
Having this information on my side is going to be very helpful for finding the root cause of the behavior.
Looking forward to hearing from you.