A
A
Alexander Ampleev2018-08-28 12:22:47
JavaScript
Alexander Ampleev, 2018-08-28 12:22:47

Why doesn't jquery DataTables example work (fixed headers in table)?

here is an example:

https://datatables.net/extensions/fixedheader/exam...

- I liked it very much, but for some reason the fixed header of the table does not work, there are no errors in the console either ..

How I do it:
copied files from example all :

5b85129170ceb084772930.png

except jquery itself.

to my project:
in the view I connect this css and this js

$this->registerCssFile('/css/fixHeader.css');
$this->registerJsFile('/js/fixHeadersTable.js');
$this->registerAssetBundle(yii\web\JqueryAsset::className(), yii\web\View::POS_HEAD);


in css, I just copied all the code from the example files sequentially
5b851336dbfea578302055.png

into js, ​​I also copied all the code from the example, except for the jquery library itself. it is built into the yii

5b851370a09d6948251182.png

code from all files, just copied and pasted into one js file in sequence

. Everything works fine except for the header fixation effect and the console does not give any errors. Can someone tell me where to look, thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Ampleev, 2018-08-29
@Ampleev

it seems that the problem was in the style conflict, everything worked

A
Anton fon Faust, 2018-08-28
@bubandos

Almost 100% sure that the problem is not using thead and tbody tags. Do you have them in your inventory?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question