-
-
Notifications
You must be signed in to change notification settings - Fork 192
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PJAX in GridView to replace ajax rendered container rather than submit whole page #99
Comments
I'm not sure it's a good idea to enable it by default... |
@yiisoft/core-developers need opinions. |
@samdark agree with you. |
Also agree with @samdark |
how about we include an option on the generator? <?= $this->pjaxEnabled ? "<?php // Pjax::begin() ?>\n" : '' ?> |
Unfortunately, PJAX does not always work as a charm. I think we should not try to force its usage, because it requires some additional experience |
Can you please specify in what cases PJAX does not work? It's actually easy to add those two lines before & after gridview, only it's bothering to do it in all index files. Of course if PJAX does not work reliably e.g. in some browsers, it should be documented and cannot be default setting. |
@lubosdz I didn't say that PJAX "does not work" in some cases. I'm talking about unobvious things, that "does not work as a charm" :) Tricky places:
So enabling it by default increases entering threshold |
You can make it yourself
|
But if we include it as an option for the generator and have that option disable by default then we are not forcing the usage of Pjax. We can just encapsulate the It can be 100% backwards compatible and the use case is very well defined. |
Guys, your are missing point of this thread - this was NOT enabling PJAX everywhere. I know one can create custom template(s) - but when default functionality works fine - why could it not be included? The reason for this to avoid submitting whole page and make Gridview functionality consistent with Yii1 (there was also only ajax submit, not whole page like now in Yii2). |
GridView has links (view, update, etc) and form (search). Okay, let's make one more call for @yiisoft/core-developers opinion. Team? |
It may do tricky stuff with nesting. Admin panels could get it complicated. I'm still for not enabling it by default. |
@samdark it doesn't need to be enabled by default. we can have a configuration in gii and that would be enough. |
OK. Disabled by default but configurable sounds fine. |
Using PJAX consistently follows original implementation in Yii1 gridview is replaced via ajax callback.
In Yii2-Gii, however this performance-wise feature has been replaced with submitting whole page.
Since few months ago Yii2 uses PJAX natively, generated Gridviews may also take advantage of it.
The text was updated successfully, but these errors were encountered: