Skip to content

TypeError: undefined is not an object (evaluating 'c.length') #77

@MMasterson

Description

@MMasterson

Hey @tigrang

I'm not sure how active this project is still, but I am running into an issue and I can't seem to figure out why. I have followed the Basic Usage Multiple Tables exactly, and ran into the admin_ prefix issue. I was able to solve it with information from issue #70.

However, once patching that issue I have run into a datatables javascript error
TypeError: undefined is not an object (evaluating 'c.length')

Any ideas on why I am receiving this issue?

Controller

public $components = array('Paginator', 'Session', 'Component1', 'Component2','DataTable.DataTable' => [
        'Order' => [
            'columns' => [
                'id'
            ]
        ],
    ]);
public $helpers = [
        'DataTable.DataTable',
    ];

public admin_index() {
...
        $this->DataTable->setViewVar(['Order']);
...
}

order.ctp

<?php
foreach ($dtResults as $result) {
    $this->dtResponse['aaData'][] = array(
        $result['Order']['id']
    );
}

Index ctp
echo $this->DataTable->render('Order');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions