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

Add minifiedAjax method to minify url generated when using get request.#13

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 4 commits into1.0fromadd-minified-ajax
Jun 26, 2017

Conversation

@yajra
Copy link
Owner

@yajrayajra commentedJun 26, 2017
edited
Loading

Fixes php artisan serve and IE issues on long URL.
Related Issues:
yajra/laravel-datatables#1225
yajra/laravel-datatables#1205
yajra/laravel-datatables#826
yajra/laravel-datatables#671
etc..

USAGE

Update html method on your service class to:

/**     * Optional method if you want to use html builder.     *     * @return \Yajra\Datatables\Html\Builder     */publicfunctionhtml()    {return$this->builder()                    ->columns($this->getColumns())                    ->minifiedAjax()                    ->addAction(['width' =>'80px'])                    ->parameters($this->getBuilderParameters());    }

@yajrayajra changed the base branch frommaster to1.0June 26, 2017 03:09
Align doc properties.Remove space after unary.
@isometriq
Copy link

I've tested usingminifiedAjax method, but columns ordering and search is not working (applied). Data is transmitted, but with model default ordering. I can see lesser GET params are sent which does not cause 404 anymore, but maybe some necessary info is being stripped?

Looks like a step in the right direction 👍

My observations:
-I feel that sending data thru GET with PHP format is too much. If you take APIs, the format is generally very compact such as?q=search-value&f=field1|field2|field3&o=field1,asc|field2,desc. I don't know all the intricacies of DataTables, so I may not be aware of some limitations...
-I think also sticking to GET method is necessary, since POST is for something else

@isometriq
Copy link

Hey, just noticed that using
->ajax(url('admin/users'))
does not seem to cause 404 errors anymore
..maybe it's a coincidence? same table and config as before

@yajra
Copy link
OwnerAuthor

@isometriq thanks for testing. I forgot to commit the changes needed on the main repo. Updates released on v7.8.1. Kindly check again.

@isometriq
Copy link

Ok, I will try soon
However, in my last test, the->ajax() method this did not cause 404 anymore
Are we supposed to still use it or->minifiedAjax() only?

@yajra
Copy link
OwnerAuthor

yajra commentedJun 27, 2017
edited
Loading

I suggest to useminifiedAjax because it is indeed a weird bug where Laravel RANDOMLY returns 404 on valid routes. I also encountered that way back and was really confused on what's happening :).

@yajra
Copy link
OwnerAuthor

On Laravel 5.5 release, I think I will also default it tominifiedAjax. Can't do it now cause its a potential BC.

@herzcthu
Copy link

This is not a fix for very big table. Still generating very long url even after minifiedAjax applied.
POST method is an only way for some case. But current version of laravel-datatables-button not support for POST method.

@yajra
Copy link
OwnerAuthor

@herzcthu Does the issue occurs only export? If yes, then maybe this PRyajra/laravel-datatables-buttons#41 would help?

ExpDevStar added a commit to ExpDevStar/Datatables-in-Laravel that referenced this pull requestDec 26, 2019
goldbright00000 added a commit to goldbright00000/laravel-project that referenced this pull requestMar 22, 2020
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

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@yajra@isometriq@herzcthu

[8]ページ先頭

©2009-2025 Movatter.jp