trait AjaxDataTableTrait

Trait AjaxDataTable.

This trait class externalize the work for AJAX DataTable.

Methods

ajaxTableDataMethod()

Return the table data using AJAX

initialize()

Initialize common properties

searchData(array $data, int $recordsFiltered, array $requestData = [])

Realize the search to database table.

array
getDefaultColumnsSearch()

Return a default list of col.

fillActions($data)

Fill 'col-action' fields with action buttons.

array
getActionButtons(string $id = '')

Returns a list of actions buttons. By default returns Read/Update/Delete actions.

Response
sendResponse(string $reply, int $status = Response::HTTP_OK)

Send the Response with data received.

getTableHeader()

Returns the header for table.

getTableBody()

Returns the content for the body of table.

getListFields()

Returns a list of fields for the tablename.

getTableFooter()

Returns a footer list of fields for the table.

Details

at line 25
ajaxTableDataMethod()

Return the table data using AJAX

at line 55
abstract initialize()

Initialize common properties

at line 64
private searchData(array $data, int $recordsFiltered, array $requestData = [])

Realize the search to database table.

Parameters

array $data
int $recordsFiltered
array $requestData

at line 99
array getDefaultColumnsSearch()

Return a default list of col.

Return Value

array

at line 116
private fillActions($data)

Fill 'col-action' fields with action buttons.

Parameters

$data

at line 145
abstract array getActionButtons(string $id = '')

Returns a list of actions buttons. By default returns Read/Update/Delete actions.

If some needs to be replace, replace it on final class.

Parameters

string $id

Return Value

array

at line 155
abstract Response sendResponse(string $reply, int $status = Response::HTTP_OK)

Send the Response with data received.

Parameters

string $reply
int $status

Return Value

Response

at line 160
getTableHeader()

Returns the header for table.

at line 183
getTableBody()

Returns the content for the body of table.

at line 208
getListFields()

Returns a list of fields for the tablename.

at line 239
getTableFooter()

Returns a footer list of fields for the table.