Is it possible to pick & choose features?

Is it possible to pick & choose features?

sviviansvivian Posts: 13Questions: 0Answers: 0
edited August 2011 in General
Is it possible to select a limited set of DataTables features to use? I'm thinking in a similar vein to jQuery UI's custom download, where I pick only the parts I am using. I don't see anything on this site but from a quick look at the code it's structured quite well so maybe it's possible manually.

Could I simply delete a section like [code]this.fnFilter...[/code] if I am not using filtering? Do you have a "dependency list" of which features require other features?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    DataTables features are listed here: http://datatables.net/usage/features . There isn't currently a way of setting the defaults, but what you can do is something like this:

    [code]
    $('#example').dataTable( $.extend( {}, defaults, {
    "bFilter": true
    } );
    [/code]

    Where 'defaults' is your default initialisation object.

    Allan
  • sviviansvivian Posts: 13Questions: 0Answers: 0
    No, what I mean is completely cutting out certain features I'm not using, not just turning them off. If I'm only using half the features I could cut out half the code to reduce the file size, download and interpretation time.

    For example if I wasn't using filtering, could I delete the whole `this.fnFilter...` section in `jQuery.dataTables.js` and recompile it?
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    You can remove the fnFilter API method no problem, but removing all the code that is related to filtering would be a lot more difficult. It is possible, but DataTables wasn't design to be modular like that.

    Allan
This discussion has been closed.