bVisible not working together with bStateSave in IE7
bVisible not working together with bStateSave in IE7
Hi Allan, hi folks,
it's me again. This time I noticed a wired behaviour in IE7. When I use 'bVisible: false' together with 'bStateSave: true', IE7 is displaying the hidden column. IE6 and FF is displaying correctly.
Here is my code:
[code]
$(document).ready(function() {
$('#datagrid').dataTable( {
"aaSorting": [[6,'asc']],
"aoColumns": [
null,
null,
null,
null,
null,
{
"bSortable": false,
"bSearchable": false,
"sWidth": "100px"
},
{
"bVisible": false
}
],
"bStateSave": true,
"iDisplayLength": 20,
"oLanguage":
{
"sUrl": "<?php
print ($skinurl);
?>languages/de_DE.txt"
},
"sPaginationType": "full_numbers"
} );
} );
[/code]
Have I done something wrong or is it an IE7 'feature'???
Greetings Chris
it's me again. This time I noticed a wired behaviour in IE7. When I use 'bVisible: false' together with 'bStateSave: true', IE7 is displaying the hidden column. IE6 and FF is displaying correctly.
Here is my code:
[code]
$(document).ready(function() {
$('#datagrid').dataTable( {
"aaSorting": [[6,'asc']],
"aoColumns": [
null,
null,
null,
null,
null,
{
"bSortable": false,
"bSearchable": false,
"sWidth": "100px"
},
{
"bVisible": false
}
],
"bStateSave": true,
"iDisplayLength": 20,
"oLanguage":
{
"sUrl": "<?php
print ($skinurl);
?>languages/de_DE.txt"
},
"sPaginationType": "full_numbers"
} );
} );
[/code]
Have I done something wrong or is it an IE7 'feature'???
Greetings Chris
This discussion has been closed.
Replies
A little bit of a stab in the dark here (don't have an IE7 computer with me just at the moment), but I'm guessing that when developing the page you were testing in IE7 with "bStateSave":true, before you added the hidden column - and then only testing in IE6, after you had added the hidden column?
My guess as to what is happening is that DataTables has stored the state of the table with all columns set to visible, so when you reload the page they will always be shown (since the information in the cookie overrides the initialisation options).
Suggested fix (assuming this is correct!) is to delete the cookie and refresh.
Regards,
Allan
Nope.
I tested several methods on several Browsers (IE6, IE7, FF2, FF3). This behaviour is only accuring with IE7. No matter if I call the bVisible before or after bStateSafe. For testing purposes I changed the calls from alphabetical order to wild one and back. I tried changing the column options, changing the syntax (to be sure to use the right IE7 syntax) and many more. No luck.
Unfortunately I have no server with my development-version online, just localhost.
The problem for itself is not that big deal at the moment. It is just 'not nice to see that column'. So, if there will be a chance for you or another javascript-expert to test this behaviour in IE7, I will be happy to get a fix (anytime in the future :-)
Regards,
Chris
I've just done some work on how DataTables deals with state saving and columns, and your example appears to work in IE7 now. Could you drop me a mail using http://datatables.net/contact and I'll e-mail you a copy of my development version of DataTables, if you are willing to give it a try. It would be great to fix this good and proper before releasing 1.5.3.
Regards,
Allan
dropped some lines in a mail. And sorry for my late answer, have been out of office for a couple of days.
Regards,
Chris
If I set it to false all works ...
[code]"bStateSave": false,[/code]
thanks
I believe that this will be fixed in the next release of DataTables. It's probably also worth deleting the cookie, like I mentioned in the other thread, just to see if that helps.
Regards,
Allan