-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using with DataTable extensions #4
Comments
It is an official extension of datatables? Could you provide me a link to the extension? |
http://yadcf-showcase.appspot.com/ |
It is an unofficial extension. I need to make a generic functionality to In the meantime, you can use the data tables asset provided in this yii2 On Thu, Aug 13, 2015 at 11:05 AM, KirillRyzhkov [email protected]
Federico Nicolás Motta |
Ok. That I have already done. The problem is that table is initialized twice in Yii then in JS. In Yii view I have <?= DataTables::widget(['id' => 'posts-grid',]); ,which becomes datatables_posts-grid. Next in JS I write With that I have an alert box saying that datatable cannot be reinitialized. I click OK I have filter on the table in everything works but problem is that alert box on page load. |
Found a fix for now. Need to use retrieve: true option in Yii view provided by Datatables to reinitialize a table in Javascript. And all Datatables options must be in Javascript code because retrieve: true will clear all settings in Yii view. |
You can use yii\grid\GridView instead of 'posts-grid',]); ?> if you want to use datatables through js. Otherwise It will try to generate 2 datatables in the same object. That is why it is fixed with retrieve => true. In both case all options must be in the Javascript object. |
You said After #2 It is necessary the implementation of a pagination in the php layer to avoid memory limit errors. Does it mean that Datatables pagination needs to be rewritten to work with Yii? |
No. The datatables pagination is working. The problem is about the way
|
Ok, thanks for explanation |
I have a problem with using extension Yadcf for Datatables. The problem is that in plain Javascript I would write $('#example').dataTable().yadcf([....]); . But in Yii2 it is already initialized and I have the error that data table is initialized twice in Yii and then in JS code. Is there any solution to initialize Yadcf in 'clientOptions' => [..]? Thanks in advance.
The text was updated successfully, but these errors were encountered: