Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[4.0] Add support for search panes extension.#137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
yajra merged 9 commits into4.0fromsearch-panes
Oct 31, 2020
Merged

Conversation

@yajra
Copy link
Owner

@yajrayajra commentedOct 1, 2020
edited
Loading

Fixyajra/laravel-datatables#2463
Fixyajra/laravel-datatables#2471
Fix#130

USAGE

// enable search panes->searchPanes(true)// enable search panes with array options->searchPanes(['viewTotal' =>true,'hideCount' =>false,])// enable search pane with SearchPane builder class->searchPanes(SearchPane::make()->cascadePanes(false)->hideCount())

@yajrayajra changed the title[4.0] Add support for search panes extension.[4.0] WIP: Add support for search panes extension.Oct 1, 2020
@yajra
Copy link
OwnerAuthor

Note to self:

It appears that custom panes are not yet fully supported for server-side but the builder added on this PR is already generating a working a scripts.

https://datatables.net/extensions/searchpanes/serverside

It is also worth noting that custom panes will not be supported by server-side processing in SearchPanes 1.1 but this is something that we are aiming to provide in the future with SearchPanes 1.2.

Also, search panes can be hooked directly to the column builder which triggers a correct ajax request.

Column::make('carrier.name')    ->searchPanes(SearchPane::make()->modelOptions(Carrier::class,'name','id'))    ->title('Carrier'),

@yajrayajra added the hacktoberfest-acceptedAccepted for Hacktoberfest labelOct 6, 2020
@yajra
Copy link
OwnerAuthor

yajra commentedOct 31, 2020
edited
Loading

Server-side implementation notes

JS Demo ref:https://editor.datatables.net/examples/extensions/searchPanes.html

As of writing, it seems like search panes on server-side only works via column definition. To implement, the following builder options can be used:

Implementation 1

// HTML Builder->addColumnDef(['searchPanes' => ['show' =>true],'targets' => [3],])

Implementation 2

useYajra\DataTables\Html\ColumnDefinition;// HTML Builder->addColumnDef(fn(ColumnDefinition$definition) =>$definition->searchPanes()->targets([3]))

Implementation 3

useYajra\DataTables\Html\ColumnDefinition;// HTML Builder->searchPanes(['hideCount' =>true])// hideCount can be removed if your search pane options supports it->addColumnDef(fn(ColumnDefinition$definition) =>$definition->searchPanes()->targets([3]))
quantrung9 reacted with heart emoji

@yajrayajra changed the title[4.0] WIP: Add support for search panes extension.[4.0] Add support for search panes extension.Oct 31, 2020
@yajrayajra merged commit52b7370 into4.0Oct 31, 2020
@yajrayajra deleted the search-panes branchOctober 31, 2020 09:26
@quantrung9
Copy link

Finally, thanks@yajra

yajra added a commit that referenced this pull requestNov 3, 2020
* 4.0:  Bump v4.34.0 🚀  Add formatted column factory. To complimentyajra/laravel-datatables#2193  Bump v4.34.0 🚀  [4.0] Add support for search panes extension. (#137)
@yajrayajra mentioned this pull requestNov 5, 2020
@matteocostantini
Copy link
Contributor

matteocostantini commentedNov 5, 2020
edited
Loading

Hi@yajra ,
i'm testing searchpane with serverside.
I see values in my single simple pane. (using modelOptions Column method : ->searchPanes(SearchPane::make()->modelOptions(Carrier::class,'name','name')) )

i'm using editor to edit name.

when i click a value in my pane i see the processing but filter not applied in resultset.

Whats appen?

this column definition

{"data":"carrier.name","name":"carrier_name","title":"Carrier Name","orderable":false,"searchable":false,"searchPanes":{"options":[{"value":"MBE","label":"MBE"},{"value":"UPS","label":"UPS"},{"value":"Corriere Espresso TNT","label":"Corriere Espresso TNT"}]},"visible":true,"editField":"id_carrier"}

can depend with $('#example').DataTable().searchPanes.rebuildPane(0, true);?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

hacktoberfesthacktoberfest-acceptedAccepted for Hacktoberfest

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Can this be used with DataTables Search Panes SearchPanes support Support the Searchpanes

4 participants

@yajra@quantrung9@matteocostantini

[8]ページ先頭

©2009-2025 Movatter.jp