Hi everyone,
I've got an igGrid that I'd like to be able to rebind to different data sources, but I'm getting the following error in
Microsoft JScript runtime error: Unable to get value of the property 'hide': object is null or undefined
The code breaks on the following statement:
this._loadingIndicator.hide()
It's line 25, Col 79451 of infragistics.ui.grid.framework.js, immediately underneath the following header:
/*
* Infragistics.Web.ClientUI Grid 12.2.20122.2029
*
* Copyright (c) 2011-2012 Infragistics Inc.
* http://ko.infragistics.com/
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* ig.dataSource.js
* ig.ui.shared.js
* ig.util.js
*/
I have attached my sample page. The first time I click on either button, I will get a grid with the appropriate columns and data. Any subsequent button-clicks fail with this error, and then the grid disappears, which is likely the result of my call to $('#placeHolder').igGrid('destroy'); (Note: In my sample, I'm only calling destroy if I've already bound the grid, because I was getting errors on my first attempt to bind when I called destroy every time.
I have also tried using $("#placeHolder").empty(); but that doesn't do the trick either. I don't get any errors, but the grid does not re-appear.
I have also tried NOT destroying/emptying the grid, but then I get a different error:
Microsoft JScript runtime error: Unable to get value of the property 'length': object is null or undefined
colsLength=cols.length
It's line 25, Col 10526 of infragistics.ui.grid.framework.js, immediately underneath the same header as above.
Also, my sample puts the grid inside of a DIV, because I had seen some threads that talk about bugs when building a grid inside of a TABLE element. I'd be willing to put the grid inside of anything, as long as it'll let me rebind!
Thanks! Let me know if there is any other information I can provide.
Jamie
Hi Jamie,
thanks for attaching such a great and self-explanatory sample : ) I am afraid this is an issue that we need to fix. As a workaround you can replace the placeholder type to be table instead of a div:
<table id="placeHolder" style="width:100%"></table>
and it will work fine. That's related to the structure of the widget & nested elements depending on the type of the element on which the grid is intantiated. If it's a table, it's wrapped with a div so that all extra UI such as the pager, etc. - gets rendered, if it's a DIV, then an extra table is created within the div, and there is some extra logic related to this ,but those are all implementation details.
We will update you with the work item number, so that you can track the progress by contacting DS, in case the workaround I have given doesn't satisfy your needs.
Thanks,
Angel
Thanks Angel! Your solution works great!
Keep me posted on a fix. (At the moment, I have no preference of table vs div, but I have seen some posts talking about problems with table mode that work fine in div mode, so it would be helpful to be able to switch over if I run into any of those problems.)
Thanks again!