Thursday, March 20, 2008

YUI datatables does not work for IE ?

I have been playing around with the datatables from Yahoo UI package for one of my customers. Much to my surprise though the code does not work for IE. I have been googling around for somebody reporting the same issue but so far I haven't found anything to the effect. I am just following the same example from the YUI site. On using YUI for my work, everything is good but then there are a few issues I am running into :

1. caching on the datatable itself does not lend itself to easy doing.
2. compatibility issues between browsers doesn't lend itself friendly to enterprise solutions.

Going to look more into this.

5 comments:

Roberto Alsina said...

I have run into this and usually the problem was having the JS code execute too soon. To see if this is the case, just move it to the very very end of the page and see if that fixes it.

Unknown said...

I have also had some issues with IE and the YUI datatable. I've found it's generally as JS issue in my setup code that worked in FireFox, but fails in IE.

One error I got a few times was "children is null or not an object" which happens when you have a trailing comma at the end of an array. You can do this in python, and it works in FireFox, but not IE.

darnes said...

Got same problem, the fun part - it was test - task, so I should do evrething correct, so after some time spent with IE, and brainsotorm - got the point


not so fun part:

IE caching evrething, even AJAX requests, so if you use dinamyc datatable with server - side sorting use no-cache header,So just send header with no - cache with request for data. I'm using php for server-side, with it

header("Cache-Control: no-cache, must-revalidate");

be sure that is on the response for the data, since dymamic datatable generates JS request to server for the data, after page loads.

Sure as second way you may add to request to server for the data random parameter, it will do the same, except you will need to do some JS work to hook the JS part of request generation.

Cesar Augusto said...
This comment has been removed by the author.
Cesar Augusto said...

use:
YAHOO.util.Event.addListener(window, "load", function() { ... });

and not:
// for jquery init code
$(document).ready(function() { ... });