mkhairi / jquery-datatables

Jquery datatables ruby gems for assets pipeline
https://datatables.net/
Other
75 stars 18 forks source link

Having trouble getting extensions to work #10

Closed alinanevins closed 6 years ago

alinanevins commented 6 years ago

Basic datatables is working great. However, I can't seem to get any of the extensions to work. For example, I added this to the head: $("#sortable").DataTable( { fixedHeader: true }); But fixed headers doesn't work, nothing seems to change. This is the same behavior I'm getting with all of the extensions. I installed this gem using your autoinstall, and enabled the appropriate extensions in datatables.scss.

mkhairi commented 6 years ago

hi @alinanevins, it should be work. did you get any error on web console?. Please check on enabled extensions on datatables.js too. And also if you use fixed navigation style on you layout, you should pass headerOffset option.

alinanevins commented 6 years ago

Thanks @mkhairi, I missed the part about enabling the extension on datatables.js. That did the trick. Where should I pass the headerOffset option?

mkhairi commented 6 years ago

@alinanevins, see https://datatables.net/reference/option/fixedHeader.headerOffset