Skip to content

It seems to be unpossible to load the grid by ajax #7

@keesschepers

Description

@keesschepers

As far as I investigated the code and tested it myself it seems to be unpossible to make datatables load the data thru AJAX by specifying the option "sAjaxSource".

I think that should be default behavior and with the datatable (or the abstract) it should be possible to render either the table HTML and the JSON response which datatable JS library needs.

Therefore it might be nice if you could create a grid like this:

$dataTable = $this->getServiceLocator()->get('Pike\DataTables')->create('my_own_grid');

Then 'my_own_grid' should be a service, which you can customize or take the abstract service from Pike self:

'service_manager' => array(
    'my_own_grid' => function($sm) {
        $dataTable = new \Pike\DataTable($adapter, $dataSource, $etc);
        $adapter->setTemplateFile('customer/template');
    }
)

Or you create it with the abstract factory:

'service_manager' => array(
    'my_own_grid' => '\Pike\DataTable\ServiceFactory',
),
'pike' => array(
    'datatable' => array(
        'my_own_grid' => array(
            'template' => 'custom/template'
        )
    )
)

I am using ZfcTwig and now Pike\DataTable isn't able to work 👎

Any ideas on this @nicovogelaar?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions