TableTools undefined initialized in 1.10b2?

TableTools undefined initialized in 1.10b2?

Steve_WebtronSteve_Webtron Posts: 19Questions: 0Answers: 0
edited April 2014 in General
in my document.ready I used to have:
[code]
TableTools.DEFAULTS.sSwfPath = "/admin/js/DataTables-1.10.0-beta.2.0b/extensions/TableTools-2.2.0/swf/copy_csv_xls_pdf.swf";
[/code]

So that when multiple tables in a page were initialized they all loaded the swf buttons.
Since I switched to dataTables 1.10 I get
TypeError: Cannot read property 'DEFAULTS' of undefined
and TableTools is of course undefined.

I load the scripts in the same order I did in 1.9.4, I just corrected the paths for 1.10.b2
[code]




[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    This is an error in TableTools 2.2.0 I'm afraid. It is fixed in 2.2.1-dev here: http://datatables.net/download/build/dataTables.tableTools.nightly.js?_=60133663e907c73303e914416ea258d8 .

    I should also point out that the global variable `TableTools` will be removed in the next major release of TableTools - and `$.fn.dataTable.TableTools` should be used instead (which does work correctly in 2.2.0).

    Allan
  • Steve_WebtronSteve_Webtron Posts: 19Questions: 0Answers: 0
    Thanks I will upgrade my syntax already, Hope this goes into the TableTools example docs soon before someone else gets stuck!
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited April 2014
    Yup - I'm in the process of updating the whole lot for the new site just now!

    Allan
  • piempiem Posts: 5Questions: 0Answers: 1
    edited May 2014

    Hello
    I'm trying to initialize TableTools..with dataTables1.10 & Jquery2.1.0 & JqueryMobile 1.4.1
    .. and TableTools doesn't show up.

    Here is the way I initialize TT, via the page's associated javascript file.. I guess I'm correct?
    (DataTables in itself works perfectly)

    function main() {
        if (jQuery('table').length)
            jQuery('table').dataTable({
    "pagingType": "simple_numbers",
    "aLengthMenu": [[10, 25, 50,100, -1], [10, 25, 50, 100, "All"]],
    "aoColumnDefs": [{ "bSortable": false, "aTargets": [ 0, 1, 6 ] }],
    "order": [[ 4, "desc" ]] ,
    "dom": "T<'clear'>lfrtip","tableTools":{"sSwfPath": "/swf/copy_csv_xls_pdf.swf"}
        });
    }
    
    

    Thank you

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Are you referencing TableTools js file in your HTML?

  • piempiem Posts: 5Questions: 0Answers: 1
    edited May 2014

    Nope, it's in the module's js main file.
    DataTables works fine. The problem is tableTools..(and surely the mistake I've done :) )

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

    We'd need a link to the page to be able to understand why it isn't working I think.

    Allan

  • piempiem Posts: 5Questions: 0Answers: 1

    It's impossible,it's not a web site, there is no real page, it's a web app on a server generated with php & {smarty} and you must have an account to login to see any page.
    But I'll think about it, maybe I'll have to buy a ticket.
    Thank you anyway

  • piempiem Posts: 5Questions: 0Answers: 1
    edited May 2014

    Ok this problem is solved, obviously, I also had to call the plugin either via my headers_includes or in the module php file.. Done.!

    Anyway... the swf is loaded.. but as many many users.. as I see..it doesn't work. (any browser)..
    I also checked the swf files.. as I could because I have no tools for this:
    FYI:
    FlashPlayerDebugger says:

    TypeError: Error #1010: A term is undefined and has no properties.
    at ZeroClipboard()

    ...I know flash s..ks big time

This discussion has been closed.