Table with flash buttons destroy bug

Table with flash buttons destroy bug

jouvenjouven Posts: 22Questions: 1Answers: 0

http://live.datatables.net/cuyemayu/15/edit

See test case comments.

Using an extend: 'copyFlash' button with an init function gives a JS error when destroying the table.

Replies

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Whats with the

    setTimeout(function(){table.destroy(true);},3000);
    
  • jouvenjouven Posts: 22Questions: 1Answers: 0

    You can replace it with "table.destroy(true);", the issue still happens.

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Thats not what im saying, im wondering why do you destroy it? is that part of hte issue?

  • allanallan Posts: 62,225Questions: 1Answers: 10,208 Site admin

    So the issue here is that you've overridden the default init function. That is used to create the Flash movie etc. So even if there weren't this Javascript error, the copy button wouldn't actually do anything (or would throw some other error when activated).

    If you want to override the default init function you would need to include the logic from the original. You could for example call $.fn.dataTable.buttons.copyFlash.init( dt, button, config );.

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Im guessing init is an alias of initComplete?
    @allan, do you have these aliases listed anywhere? I always see diff options that seem to do the same things

  • allanallan Posts: 62,225Questions: 1Answers: 10,208 Site admin

    No - init in this case is buttons.buttons.init. It is the Button initialisation function.

    The only alias are the Hungarian / camelCase aliases (there are some very minor ones in addition to them, but only in order to make that conversion work).

    Allan

  • jouvenjouven Posts: 22Questions: 1Answers: 0

    I see, using button init function prevents the default extended action... meh this used to work in tableTools.
    Anyhow the $.fn.dataTable.buttons.copyFlash.init( dt, button, config ); line doesn't work, it's undefined.

  • allanallan Posts: 62,225Questions: 1Answers: 10,208 Site admin

    Simple typo:

    $.fn.dataTable.ext.buttons.copyFlash
    

    Allan

  • jouvenjouven Posts: 22Questions: 1Answers: 0

    I was going to tell I found that call too. With that call it works.

    Thanks.

This discussion has been closed.