DataTable js showing error message - yii2
DataTable js showing error message - yii2
YiiDeveloper
Posts: 5Questions: 2Answers: 1
Hi, I am creating a project using yii2. I linked datatable js and css files using CDN. However, when i run project, i got following errors:
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I found solution for error1 and erro2. I forgot to link another js file:
"https://code.jquery.com/jquery-1.11.3.min.js"
However, I cannot find solution for the third error
If you link to the page I'd be happy to take a look. There error suggests that DataTables hasn't been loaded or jQuery has been loaded multiple times.
Allan
code in my view file is as follow:
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View /
/ @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Members';
<?php > ``` ``` ?>$this->params['breadcrumbs'][] = $this->title;
I have created action controller called actionTable and linked it to the view file. The interesting thing is that the same formula worked for yii1.
i found solution. There went something wrong with js file. Instead of using CDN, local js files was used. I added css and js file in appasset :
public $css = [
'css/site.css',
'css/datatables.css',
As a result, I got result
Thanks for posting back. Good to hear you have it working now.
Allan