-
Notifications
You must be signed in to change notification settings - Fork 154
Fixing some bugs and adding new features #267
Conversation
I am new on github as pull requester, so sorry... |
Next commit (5bd0254) add a new option 'emptyAtEnd' and method setEmptyAtEnd() which allow to sort table such that empty fields will always at end of table. |
Two new bugs fixed: |
Forget to say: I using Datatable 1.10.4 |
@dlnsk this branch ( |
@timgws I use it and it works well. version3 have same critical bugs which I fix. So, maybe 1.10 unsupported just because have some bugs? ;o) |
Does your branch still work with datatables 1.9? |
@timgws I have install datatables 1.9.4 and test my branch with it. It works fine! $table = Datatable::table()
->showFooter()
->setId('stock-table')
->setClass('table table-bordered dataTable compact')
->addColumn('Артикул', 'Торговая марка', 'Описание', 'Аур', 'Мег', 'Мск', 'Бел', 'Цена')
->setUrl(route('api.stock'))
->setCallbacks('fnServerParams', 'passAdditionalParams')
->setOptions(array(
'sDom' => 'rtpli',
'oLanguage' => [
"sEmptyTable" => "Ничего не найдено",
'oPaginate' => [
'sFirst' => '<<',
'sLast' => '>>',
'sPrevious' => '<',
'sNext' => '>',
]
],
'aoColumns' => [
['sWidth' => '15%', 'sClass' => 'details-control'],
['sWidth' => '25%'],
null,
['sWidth' => '1%'],
['sWidth' => '1%'],
['sWidth' => '1%'],
['sWidth' => '1%'],
['sWidth' => '7%', 'aDataSort' => [7, 0]]
],
"fnFooterCallback" => "function() {
$('.footer3').html('qwerty');
}"
)
)
->noScript(); |
Conflicts: src/Chumper/Datatable/Engines/QueryEngine.php
This is my initialization for datatable 1.10.4 (it only difference by option's names which was changed in 1.10): $table = Datatable::table()
->showFooter()
->setId('stock-table')
->setClass('table table-bordered dataTable compact')
->addColumn('Артикул', 'Торговая марка', 'Описание', 'Аур', 'Мег', 'Мск', 'Бел', 'Цена')
->setUrl(route('api.stock'))
->setCallbacks('fnServerParams', 'passAdditionalParams')
->setOptions(array(
'dom' => 'rtpli',
'language' => [
"lengthMenu" => "Показывать _MENU_ записей",
"info" => "Отображаются записи с _START_ по _END_ из _TOTAL_",
"emptyTable" => "Ничего не найдено",
"infoEmpty" => "",
'paginate' => [
'first' => '<<',
'last' => '>>',
'previous' => '<',
'next' => '>',
]
],
'columns' => [
['width' => '12%', 'className' => 'details-control'],
['width' => '25%'],
null,
['width' => '1%'],
['width' => '1%'],
['width' => '1%'],
['width' => '1%'],
['width' => '7%', 'orderData' => [7, 0]]
],
"footerCallback" => "function( tfoot, data, start, end, display ) {
var api = this.api();
$( api.column( 5 ).footer() ).html('123');
}"
)
)
->setCallbacks('columnDefs', '[{"targets": 7, "render": renderPrice}]')
->noScript(); |
You can get this data using "fnInitComplete" or "fnServerData" or "ajax.json()" or something else. More info: * http://datatables.net/reference/api/ajax.json * http://stackoverflow.com/questions/6090260/jquery-datatables-return-additional-information-from-server
Next feature allow to return additional data from server using ajax. |
Fixing some bugs and adding new features
Merging this has broken the unittests for |
If I use calculated field in query I have an error because $this->originalBuilder->count(); produce "select count(*) as aggregate", so it haven't calculated fields.
I haven't opportunity to test it with "distinctCountGroup" option.