Shortening the Script

Shortening the Script

scookescooke Posts: 1Questions: 0Answers: 0
edited August 2013 in General
I am using Datatables in a CMS that requires I paste the script in to the CMS's javascript widget but it limits the size of the script to 65535 characters. Even if I minify the script I am still almost double that size. I am using the script in the hidden columns fashion like this:

[code]

$(document).ready(function() {
$('#example').dataTable( {
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
"bInfo": false,
"bAutoWidth": true

} );
} );


[/code]

Are there any functions in the script that are not in use when using it this way? I tried just putting the code on my server and linking to it but the CMS does not offer a way to do this. I think that's crazy but after going back and forth with their tech support people, it seems they don't offer this as an option. I am wondering if I can cut some of the code out to shorten it. Thanks so much for any suggestions.

Replies

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    You can probably rip out the API stuff and the Ajax stuff. Also the sorting and pagination by the look of it. It will be messy though since so many parts are interdependent (particularly around the sorting) - there isn't an easy way of doing it is the long and short of it.

    DataTables v1.11 is going to be a lot more modular so it will be possible to do this, but I'm afraid that's a little way out with v1.10 still in development!

    Allan
This discussion has been closed.