Confusion about css and js files needed after the pairing up bootstrap with datatables

Confusion about css and js files needed after the pairing up bootstrap with datatables

machinariummachinarium Posts: 17Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Hi, all,
Maybe it's a quite stupid question or is an already-asked question. But I promise that I get something new. According to the link http://www.datatables.net/blog/Twitter_Bootstrap_2 and the example http://www.datatables.net/media/blog/bootstrap_2/
We can see only DT_bootstrap.css is included, not the original css file of DataTables. However, using Firebug, we can see the generated html where there is a div whose css class is datatables_Wrapper. But there is no such css class definition, which only exists in the non-included css file jquery.dataTables.css. So my question is whether we should include the original css file of DataTables, or it's a mistake for the example.

Best wishes,
Arthur

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You don't need the DataTables CSS - just the bootstrap one. There is a class `dataTables_wrapper` sure - but it doesn't he to be used :-)

    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    Since [quote]dataTables_wrapper[/quote] only exists in a never-included css file and doesn't need to be used, why is there such snippets of code in [quote]DT_bootstrap.js[/quote].
    [code]
    /* Default class modification */
    $.extend($.fn.dataTableExt.oStdClasses, {
    "sWrapper": "dataTables_wrapper form-inline"
    });
    [/code]
    It really makes user uncertain and uncomfortable. Why don't we just remove dataTables_wrapper?
    BTW, thanks for quick reply.

    Best wishes,
    Arthur
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You are welcome to do so if you so wish! The wrapper class is useful perhaps if you want to style your DataTables enhanced tables differently from other tables on the page and the inline form is there for inline form elements.

    Feel free to change as you want :-)

    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    Cool.
    And for usability of that guideline about combining bootstrap and datatables, you guys should remove dataTables_wrapper from the definition of sWrapper in that code snippet. Because maybe someday in the future, one user also needs to integrate bootstrap and datatables, and he/she does it according to the tutorial, however, a couple of questions may popups in his/her mind.
    "what's dataTables_wrapper? why can't i find its definition? Am I missing something?"
    Especially when one's application doesn't go with one's expectation, clear and unambiguous steps and docs will be very helpful for debugging.

    Best wishes,
    Arthur
This discussion has been closed.