-
Notifications
You must be signed in to change notification settings - Fork 15
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
LinkColumnType : why default target="_self" #103
Comments
To complete my message : I think the I can make the MR if it makes sense |
Hey @bdecarne! Thanks for the report. I quickly glanced at one of my applications using the bundle, and I can confirm you're right.
To be honest, I simply looked at the docs of the anchor element, which described a So, as you suggested, this would require making following changes:
I've noticed the Pull request would be highly appreciated, if you're willing to do that! Cheers. |
Upon further testing, I don't really understand what difference would the |
You are right : sortable links should have this property too. It works without, but the whole page is loaded instead of just the frame. It makes the |
Alright, thanks for confirming. I was focused solely on the fact that the request was sent asynchronously, not that it targeted the whole page, instead of a frame. |
Thanks for the help! Included in the v0.18.1 release. |
Could you add a short example about how to make a table works inside a Turbo frame? I need to sort and paginate a table without full load page refresh (if it's possible) |
Hey @davidromani, all built-in themes wrap each data table in their own turbo frame, so it works out-of-the-box: data-table-bundle/src/Resources/views/themes/base.html.twig Lines 12 to 24 in 2af2c8e
When using a completely custom theme with custom |
Thanks @Kreyu I'm figured out that what I need to achieve, indeed, is the following situation: I need to disable Turbo Drive (any link clicked forces a full page reload) globally but I want to enable Turbo Frames (any link clicked inside the frame, I want to replace only the inside’s frame with the async response result)… it’s possible to achieve this use case? |
I usually have turbo drive enabled throughout the project, and if something (e.g. link, form) requires it to be disabled, I just add the Never done that in the opposite way, but maybe wrapping the whole data table in element with
So, maybe something like this will work? <div data-turbo="true">{{ data_table(products) }}</div>
{# or in theme #}
{% extends '@KreyuDataTable/themes/bootstrap_5.html.twig' %}
{% block kreyu_data_table %}
<div data-turbo="true">{{ parent() }}</div>
{% endblock %} |
@Kreyu Sorry for bothering you again. Overriding the block I'm extending from {% block kreyu_data_table %}
<div data-turbo="true">
{{ parent() }}
</div>
{% endblock %}
{% block table %}
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
{% if title %}
<div class="box-header">
<h6 class="box-title">
{% if translation_domain is not same as false %}
{{ title | trans(title_translation_parameters, translation_domain) }}
{% else %}
{{ title }}
{% endif %}
</h6>
</div>
{% endif %}
<div class="box-body table-responsive no-padding">
{% with { table_attr: { class: 'table table-bordered table-stripped table-hover sonata-ba-list' } | merge(table_attr | default({})) } %}
{{ parent() }}
{% endwith %}
</div>
</div>
</div>
</div>
{% endblock %} |
Hey @davidromani, sorry for late response, I've created a separate issue #152 for that, I'll try to fix this today. |
Hi !
Is there any reason to make target option required and "_self" by default in the LinkColumnType ?
I have the impression that this behavior causes Turbo Drive to malfunction. I'm not a specialist in this library, but I get the impression that links with target=_self are ignored by Turbo.
EDIT : i just saw this issue hotwired/turbo#1113
The text was updated successfully, but these errors were encountered: