Using bower with datatables

Using bower with datatables

critcrit Posts: 3Questions: 1Answers: 1

These are total noob questions.

My debugger value is: elekod

I want to use datatables for bootstrap using bower. I do already use npm and bower, but I'm not that experienced with it, so I'm not sure from the directions if you have to install BOTH through npm and bower, or EITHER through npm or bower.

Here is what I have tried, and the results of it.

I've done bower install --save datatables.net and bower install --save datatables.net-bs.

I have Grunttasks to combine my scripts and css. I've added bower_components/datatables.net/js/jquery.dataTables.js and bower_components/datatables.net-bs/js/dataTables.bootstrap.js to my uglify task, and bower_components/datatables.net-bs/css/dataTables.bootstrap.css to my css compression task.

But I'm not getting all the CSS. The sorting arrows are missing, and the previoius/next lists items are not styled. I'm pretty sure this is related to the bower install method, as it was fine when I pulled in the css from the cdn, but broken when I removed that link attribute. I can see that the dataTables.bootstrap.css has been added to my compressed css, though.

Do I need to do npm install for both packages as well?

This question has an accepted answers - jump to answer

Answers

  • critcrit Posts: 3Questions: 1Answers: 1

    Update on this: I did get the pagination bars by including the @import "pagination.less"; component in my custom-bootstrap.less file. However, I still can't get the sorting arrows. I thought it would be glyphicons.less but that is not working. If I could just find the right component ....

  • critcrit Posts: 3Questions: 1Answers: 1
    Answer ✓

    I figured this out. I had to copy the glyphicons fonts into my fonts folders using a grunt copy command.

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Great to hear you got it sorted out. Thanks for posting back!

    Allan

This discussion has been closed.