Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Fixing some bugs and adding new features #267

Merged
merged 8 commits into from
Mar 27, 2015
Merged

Conversation

dlnsk
Copy link

@dlnsk dlnsk commented Mar 23, 2015

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.

@dlnsk dlnsk changed the title totalCount rise an error if table filtering on calculated field Fixing one bug and adding new features Mar 24, 2015
@dlnsk
Copy link
Author

dlnsk commented Mar 24, 2015

I am new on github as pull requester, so sorry...
Next commit (01b3afb) allow to use sorting on multiple columns described here: https://datatables.net/reference/option/columns.orderData

@dlnsk
Copy link
Author

dlnsk commented Mar 24, 2015

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.

@dlnsk
Copy link
Author

dlnsk commented Mar 25, 2015

Two new bugs fixed:
c41cff7 is critical bug because some time options don't separate by commas, so it rise a javascript error and table don't display.
10b9c5b - if option was an array we got array with object inside. That's very strange. So some options didn't work (for example, https://datatables.net/reference/option/columns)

@dlnsk dlnsk changed the title Fixing one bug and adding new features Fixing some bugs and adding new features Mar 25, 2015
@dlnsk
Copy link
Author

dlnsk commented Mar 25, 2015

Forget to say: I using Datatable 1.10.4

@timgws
Copy link
Collaborator

timgws commented Mar 25, 2015

@dlnsk this branch (master) is not for support Datatables version 1.10. You should swap to version3 if you want to support Datatables 1.10.

@dlnsk
Copy link
Author

dlnsk commented Mar 25, 2015

@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)

@timgws
Copy link
Collaborator

timgws commented Mar 25, 2015

Does your branch still work with datatables 1.9?

@dlnsk
Copy link
Author

dlnsk commented Mar 26, 2015

@timgws I have install datatables 1.9.4 and test my branch with it. It works fine!
This is my initialization for datatable 1.9.4:

$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
@dlnsk
Copy link
Author

dlnsk commented Mar 27, 2015

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();

@dlnsk
Copy link
Author

dlnsk commented Mar 27, 2015

Next feature allow to return additional data from server using ajax.

Chumper pushed a commit that referenced this pull request Mar 27, 2015
Fixing some bugs and adding new features
@Chumper Chumper merged commit 147ba34 into Chumper:master Mar 27, 2015
@timgws
Copy link
Collaborator

timgws commented May 5, 2015

Merging this has broken the unittests for QueryEngineTest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants