IE problems (again, sorry)

IE problems (again, sorry)

I have table getting 380 rows back from a sql server Stored Proc in asp.net, which are going into an asp:repeater. It is taking 95 seconds to display in IE8 or IE9. If I change the meta equiv tag to be ...IE=7 it runs in about 40 seconds, but other things break, so I have to keep it at IE=8 at minimum (which breaks rounded corners, but whatever). 40 seconds is still unacceptable anyway.

It loads in 6 seconds in Firefox or Chrome. Unfortunately this is a Microsoft-centric company, I have no option to recommend non-IE browsers.

I have tried to set bDeferRender but it makes no difference and probably wouldn't work anyway as I immediately need to run math against oData for the whole table. Also there is no pagination, the user needs to be able to see the whole table even if it was ten screens long.

I've tried an alternate approach, using $.ajax to get the data from an asmx service, but have not been able to get it to render. I don't seem to be able to understand the syntax and sequence to destroy the table and refill it from the ajax return. I'm using the NewtonSoft code to convert the returned table to json, and then using results.d to get to the actual json. Yes, the returned json is valid and matches my table schema correctly.

I have a screen shot of the ajax code trying to use "aData = results" to apply the returned data to the table but without success. Don't see a way to insert images here so I guess you'll just have to picture it failing in your mind!

My table has 32 hidden columns and 12 visible, which has been very handy for doing math against hidden values, but removing the hiddden columns hasn't seemed to help either.

This is career-hinging for me (Giant Salary Review application at a large multinational company, deadline tommorow) so any help would be HUGELY appreciated.

-Bob Graham

Replies

Is your table in a display:none element on initialisation? If so, try removing that to see if that improves the speed. We've found in the forum before that IE does something mental with parsing the DOM of hidden elements that seriously slows things down.

Beyond that, I would say that even 6 seconds is a shockingly long time for only 380 rows. Can you run the debugger ( http://debug.datatables.net ) over your table so I can see its configuration? It would also be work while checking to see how long the Ajax return is taking to load using Firebug or Inspector. And finally, hidden columns can make a difference, but it shouldn't be significant - however using mDataProp might help speed things up a bit, allowing you to not use hidden columns: http://datatables.net/blog/Extended_data_source_options_with_DataTables .

If I remove all the hidden columns and post processing after the DataTables has done its thing, it only runs about 1 second faster.

Pulling my hair out, only the most senior management will see this issue.

I've uploaded debug data, the debug code is: awucuh

It's only the second table, tblIndirEmployees, that ever has a lot of records and loads slowly.

I tried some old suggestion I found in old posts about swapping out a line in fnGatherData that used innerHTML, but it made no difference. I also studied my JavaScript for any dangling commas, used js lint as well, can't find any issues. (Well js lint *finds* issues, but most of them have to do more with Mr. Crockfords feelings than any real problem.)

Heh - good old jslint. I do actually run DataTables through jslint before every release (actually on every build) to make sure I don't do anything really daft, but there are a few options set that doesn't make jslint hate my coding style...

Anyway, how easy would it be for you to modify the table to not have so many hidden columns and use mDataProp instead? DataTables is currently creating a lot of cells and removing them from the DOM, which is just wasted processing. I'm not sure that this fundamentally is the issue, but it is certainly what stands out for me with 30 odd hidden columns, so that would be my first port of call.

So I removed all of the hidden columns but one, and it is much faster. Still, it's almost zero delay in Firefox/Chrome, but a full minute for my user with the most indirect reports under him.

I'm binding this in the backend with a Linq datatable (actually the return from a sql stored procedure). Is there any way to use mDataProps with that scenario? My table won't recognize the data if it comes in via json.

I've tried running the debug tool against the new version with all three browsers, it just runs endlessly, never finishes ( > 20 minutes ).

mDataProp can be used to allow DataTables to consume any data source: http://datatables.net/blog/Extended_data_source_options_with_DataTables .

You've got less than 400 rows there, but its taking about 1 minute to render in IE9? There is something very certainly wrong there. Can you run your table through the debugger again please now that you've removed columns? Also I wonder if you add a setTimeout() with a delay of say 3 seconds around your DataTables initialisation, does that help at all (I'm just wondering if you have a framework which hides the page / table before it is initialised, since it is increasingly sounding like that might be the issue). Beyond that, I would probably need to see the table myself to see what is happening.

As I mentioned in the previous post, the debugger gets stuck in all three browsers with the changes I made.

My DataSource is tied to the table (inside an "asp:repeater" control) at the server before it's sent to the client, and at the client the DataTable is applied. Can I add mDataProps after the table is "DataTabled"?

I'll try adding the time out.

BTW, when coming to the client with table visible and populated, is there an appraoch you know of that prevents the dreaded FOUC while DataTables is doing its thing?

I tried setting a debug point at the start and end of fnGatherData, as some folks have said that that is where IE bogs down, but it seemed to jump past that in a heartbeat.

My repeater control is built along the typical ASP.NET approach of creating item templates, each one having an element that tells it which data item it should display. I can't seem to get the table to accept a perfectly valid json source and apply it to the table. This would be the best approach to switching to mDataProps, but not if I can't get the table to bind to the data. Do you have any Microsoft junkies in the prime contributors to the forum? Without this capability I'm stuck with populating the table at the server as a "dumb" table and sending it to the client that way.

So many questions, so little time. If I don't publish this app today I should probably not count on having a job tomorrow. (The speed issue is not stopping me, just the other tasks. They have accepted the speed issue as it only affects a couple people badly and we can whisper to them to use Firefox, though it's "against policy").

Its odd that the table get stuck in the debugger for certain - there is certainly something very odd going on somewhere! I really do think I would need to see the table before I would be able to offer any further help. Is presume its an internal app can I can't get access to from what you are saying though?

It's a salary survey for a decent size multi-national corporation. I sold my boss hard on using DataTables and now it's making me look bad. No one else to blame, you haven't charged me anything for it and I'd like to contribute to further development on it, I still think it's an excellent open source project.

What would you need to see? The dollar values i use are all fake, but there is still some confidential data I can't share.

I can send the entire javascript and a view of the HTML source I suppose.

Ideally the table that you are using, on the server you are using and with the data you are using. If it is possible for just me to see it, you can PM me by clicking on my user name in the forum and clicking "Send message". If that isn't possible because its behind a firewall, then I need some way to recreate the issue - otherwise there is very little I can do to offer help. As I say, it really shouldn't be that slow, so off the top of my head, I don't know what is happening.