NullRefExcep / yii2-datatables

Yii2 Widget for DataTables jQuery plug-in
http://www.datatables.net/
MIT License
72 stars 46 forks source link

Error while retriving custom generated field with ajax #40

Closed Matvik closed 6 years ago

Matvik commented 6 years ago

I have extended column configuration like

[
                'label' => 'Name', 
                'value' => function($data) { 
                     return = $data->name
                },
            ], 

And serverSide is set to true. It is work fine at simple column config, but custom column generates datatables error in alert window DataTables warning: table id=w1 - Requested unknown parameter '0' for row 0

ZAYEC77 commented 6 years ago

Hello @Matvik Maybe you could try solution like this:

'columns' => [
        'name',
],
Matvik commented 6 years ago

Yes, but this is only example, and i want to be free when showing data in table, as it is when using regular yii 2 grid view table.

ZAYEC77 commented 6 years ago

We didn't provide syntaxes form your example Please, check the readme. If you want some custom stuff, you could implement own class with custom logic. You could check LinkColumn as example.

If you think it could be useful for anyone else -- feel free with PR.

Matvik commented 6 years ago

Ok, thank you

ZAYEC77 commented 6 years ago

Sure, your welcome) Please, close issue, if you don't have others questions.