Hide alerts from datatable

Hide alerts from datatable

dharricdharric Posts: 17Questions: 0Answers: 0
edited April 2011 in General
I am getting some unwanted alert messages from my datatable. It does not seem to cause any issue on the control though so I just want to hide or prevent this alert from showing to the user. The message is cannot reinitialise datatable (I am not trying to reinitialise the datatable and this alert only comes up on ie8). Is there some way to do this?

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    You can use $.fn.dataTableExt.sErrMode ( http://datatables.net/development/ ) to have DataTables throw an error rather than an alert - but that will interrupt the JS "thread". DataTables only gives an alert when there is something wrong, so it would be worth looking into what is triggering it. It sounds like you might be calling $().dataTable with parameters twice?

    Allan
  • dharricdharric Posts: 17Questions: 0Answers: 0
    Its a very bizarre issue. But I'm not calling it twice. What's going on is a have a fairly complex page. I'm also using things like jquery tabs and dynamic moving and resizing of some other controls on the page. So when I deploy my site it works great on firefox 4. but I get the error from ie 8. Same code for both browsers.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    You could set bRetrieve and that will make the message "go away" - although it might be hiding another problem. There must be something on the page which is making it thing that there are multiple tables being initialised. If you could give us a link that would be useful.

    Allan
  • dharricdharric Posts: 17Questions: 0Answers: 0
    So I ended up setting sErrMode to throw and catching it in a try block. That seems to stop the alert, but allow the page to continue. I know logically what you're saying is right, but to give you some idea of why I'm pretty certain I'm not reiniting it. The site was fine until I started to manually change the sizes of some of the other tables on the page (they don't use datatables and they live on a different tab). I would love to give you a link, but this is inside my corp firewall. Thanks for your help.
  • jabberjabber Posts: 23Questions: 1Answers: 0
    I also can't prevent alert message.
    In my snippet it triggers after cell update.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    Jabber, are you using jeditable? That alert message is a jeditable message if your server-side script doesn't return the same value back that it received for the cell update. Tell your server side script to echo the value back if it succeeded in updating the database.
  • jabberjabber Posts: 23Questions: 1Answers: 0
    edited November 2011
    @fbas

    Thank you for your post, i use jeditable (editable function) in conjunction with jquery.dataTables.editable (makeeditable function)
    After your suggestion, at the end of my PHP script i put "echo $_REQUEST['value'];"
    This is the only output.
    The problem remain, at client side i see cell (innerHTML) value in alert message.

    I've also tried "bRetrieve" property but everything remain the same.

    Any ideas ?
    J
  • jabberjabber Posts: 23Questions: 1Answers: 0
    Now i have modified my script (client and server side) and i use only jeditable plugin.
    All works fine and alert message is disappeared!
    As you said (fbas), i've modified my server side script to echo the value back.

    Thank you
    J
This discussion has been closed.