bVisible not working together with bStateSave in IE7

bVisible not working together with bStateSave in IE7

ChrisSChrisS Posts: 14Questions: 0Answers: 0
edited September 2009 in General
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

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Chris,

    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
  • ChrisSChrisS Posts: 14Questions: 0Answers: 0
    edited September 2009
    Hi 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
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi 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
  • ChrisSChrisS Posts: 14Questions: 0Answers: 0
    Hi 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
  • pakypaky Posts: 106Questions: 0Answers: 0
    edited November 2009
    I've same problem ... bvisible don't hide column in IE8 ... in firefox works ... (in my option [code]"bStateSave": true,[/code])

    If I set it to false all works ...
    [code]"bStateSave": false,[/code]

    thanks
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi paky,

    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
  • aluitinkaluitink Posts: 4Questions: 0Answers: 0
    Allan, I am using V1.6.2 and I have this issue within FF ... any suggestions?
  • aluitinkaluitink Posts: 4Questions: 0Answers: 0
    Please disregard my last comment, it is important to note that the cookie doesn't know when you have made a change in the code, you will need to delete the cookie if you hide a column. 4 hours of stupid troubleshooting :P
  • Martin_SMartin_S Posts: 8Questions: 0Answers: 0
    Thanks for this posts, I also wasted several hours last night (2-4am) to figure out what's wrong. :-(
This discussion has been closed.