Skip to content

Replies

0
Elin
Elin answered on Jun 12, 2014 11:59 AM

I have updated the Infragistics script files to the latest ones we have, 2013.2 and that seems to have solved that problem. I can now successfully run your sample when integrated to our solution and I think I have targeted my main issue.

The original error I had was:
Unhandled exception at line 226, column 27387 in http://localhost:55765/igniteUI/js/infragistics.core.js
0x800a138f – JavaScript runtime error: Unable to get property 'length' of undefined or null reference

And I can replicate that in your sample by simply modifying your GetGridData method to return a string instead of a DataResult (I've attached a sample with these modifications).

The thing is that due to our dataset being generated by user input at runtime we cannot know what columns will exist or how many. The only thing we have to work with is a C# DataTable (which cannot be serialized "as is" due to circular references) so we are building our own JSON and hence we need to return a string, not an object from the server web method. Can you please look at this and provide a sample where the web method returns a string?

Thank you!

EDIT:

I obviously need to JSON.parse() the response from the server in the client, just as ou would in a normal AJAX call. Where would I add that logic?

0
Elin
Elin answered on Jun 12, 2014 10:33 AM

Your sample works if used as is but it seems to be some issues with the Infragistics scripts/version we use.

when changing the
//

// ]]>
script tags:

 <script src="http://cdn-na.infragistics.com/jquery/20141/latest/js/infragistics.core.js"></script&gt;
 <script src="http://cdn-na.infragistics.com/jquery/20141/latest/js/infragistics.lob.js"></script&gt;

To the Infragistics script files we use (another version):

<script type="text/javascript" src="scripts/infragistics.core.js"></script>
<script type="text/javascript" src="scripts/infragistics.lob.js"></script>

I get an error in your sample version saying:

Unhandled exception at line 194, column 29000 in http://localhost:56226/scripts/infragistics.core.js
0x800a138f – JavaScript runtime error: Unable to get property 'childNodes' of undefined or null reference

Changing back to the script files you originally used solves this error. We are using version 13.1.20131.1012.

0
Elin
Elin answered on Jun 11, 2014 2:46 PM

Please take a look at my post from 06-02-2014 1:34 PM as we still have issues with this and are unable to continue until this is resolved.

0
Elin
Elin answered on Jun 10, 2014 9:36 AM

Do you have any update on this?

0
Elin
Elin answered on Jun 2, 2014 1:34 PM

Hey Maya,

The string sent from the server to the client side (preivously via an explicit ajax call and then bound to the grid via dataBind and now sent back from the function URL given to dataSourceURL) looks like this:

"{"totalRowCount":3,"pageRowCount":40,"rowSelectorVisible":"True","wordWrapGrid":"False","data":[{"Date":"\/Date(+1333324800000)\/","Id":"1"},{"Date":"\/Date(+1333324800000)\/","Id":"2"},{"Date":"\/Date(+1333324800000)\/","Id":"3"}]}"

Where the "data" property is what shold be bound to the grid. The other information is just meta data we need for other purposes. This return string looks the same as when we had the explicit ajax call and manually destroyed and re-bound the data on each interaction earlier, and during that time we set the responseDataKey to "data" and it worked fine.

But after switching to dataSourceUrl (without changing the server side so the same string is returned) and letting the responseDataKey still be "data" it doesn't work anymore. It reaches the server side method and the string is returned as expected, but then infragistics.core.js crashes cause _data is undefined saying:

"Unhandled exception at line 194, column 25748 in http://localhost:55765/igniteUI/js/infragistics.core.js

0x800a138f – JavaScript runtime error: Unable to get property 'length' of undefined or null reference"

So I have two questions:

– In what way to we need to modify our server side stringification of the data returned to the client, AND

– What if the data set should be empty for those user parameters, how can we return an empty set without getting a grid exception. Just return the headers?

0
Elin
Elin answered on May 15, 2014 10:04 AM

Thank you for all the help Maya, I will give this a try as soon as I can!

0
Elin
Elin answered on May 14, 2014 1:12 PM

Hi Maya,

I will try using renderMulticolumnHeader and get back to you on that.

Regarding the other issue we are not using remote via the DataSourceURL. Instead we are catching the columnSorting event and from there issuing an Ajax call back to the server for the filtereed/sorted/paged data. The server then passes on that request to the DB and we handle all filter, sort and paging in an SP in the DB. We do not wish to send the entire data set back to the server and handle the operations there since the data sets can be huge.

Looking at your MVC example it looks as if the server always fetches the full data set from the DB and then filters out before sending it to the client, which is not the behavior we are looking for. Can we use DataSourceURL with ASP.NET (we are using Ajax calls from the client to static WebMethods in our code behind) to fetch data anyway?

Could you please provide an ASP.NET example using remote filtering/sorting or paging with DataSourceURL. If possible, please also include how we can reach information about which column is being filtered/sorted and on what value/sort direction. I assume this can be fetched from the query string?

Also, as a side note. I did find this information:

"Sorting persistence is true by default. This is a breaking change. When you enable igGridSorting you are already using it in a persist mode. This means that after explicitly calls of dataBind(), that persistence is applied for UI and data source view (the sorting indicators and the CSS classes are applied, the data source remains sorted)"

(http://pt-br.infragistics.com/help/jquery/igGrid_Sorting_Overview.html)

So according to this even if we explicitly call dataBind() we should still not need to manually re-apply the GUI properties of the sorting, which it seems we have to do.