This question has been flagged
1 Reply
8939 Views

I need the table with  Fixed Columns so am including script files from below link

\https://datatables.net/extensions/fixedcolumns/examples/initialisation/left_right_columns.html

<template id="fc_assets_backend" name="account assets" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

<script type="text/javascript" src="/purchase_requisition/static/src/js/dataTables.fixedColumns.js"></script>

<script type="text/javascript" src="/purchase_requisition/static/src/js/jquery.dataTables.js"></script>

<script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css" />

<link rel="stylesheet" href="https://cdn.datatables.net/fixedcolumns/3.2.4/css/fixedColumns.dataTables.css" />

</xpath>

</template>

Getting below error:

web.assets_backend.js:2824 Could not get content for jquery-1.12.4.js defined in bundle 'web.assets_backend'.

(anonymous) @ web.assets_backend.js:2824

web.assets_backend.js:2827 Could not get content for /js/jquery.dataTables.js defined in bundle 'web.assets_backend'.

(anonymous) @ web.assets_backend.js:2827

web.assets_backend.js:2830 Could not get content for /fixedcolumns/3.2.4/js/dataTables.fixedColumns.js defined in bundle 'web.assets_backend'.

(anonymous) @ web.assets_backend.js:2830

web.assets_backend.js:2795 Uncaught TypeError: $(...).DataTable is not a function

Please help me to resolve this error

Avatar
Discard
Best Answer

you dont need to include the jquery lib, and also cdn will not accepted I think.

So download the lib and include it under your custom addon and give the path within the script tag.

Avatar
Discard
Author

<script type="text/javascript" src="/purchase_requisition/static/src/js/dataTables.fixedColumns.js"></script>

<script type="text/javascript" src="/purchase_requisition/static/src/js/jquery.dataTables.js"></script> Cant get function from this file