APYDataGridBundle icon indicating copy to clipboard operation
APYDataGridBundle copied to clipboard

Link on a Column

Open pietro2328 opened this issue 10 years ago • 6 comments
trafficstars

Hi, I work with a Vector Source, and I want to create a link on a specified column. How can I make that? I'm sure must be very easy. Have you any example?

pietro2328 avatar Nov 22 '14 13:11 pietro2328

A link to launch a search with the value of this column? Or just a simple link with the value of the column?

Abhoryo avatar Nov 22 '14 22:11 Abhoryo

Sorry, You have already answered. I must only override the template. It's like this:

{% block grid_column_subject_cell %}<a href="{{ url("ticket_edit", {"ticketId": row.field('id')}) }}">{{ value }}{% endblock grid_column_subject_cell %}

Tks.

pietro2328 avatar Nov 23 '14 00:11 pietro2328

hi, i want a link in a specified column(id) to show the entity

doncamalote avatar Mar 12 '15 13:03 doncamalote

Some news ?

QuentinCurtet avatar Nov 07 '16 16:11 QuentinCurtet

Override your column:

{% block grid_%grid_id%_column_id_%column_id%_cell %}
    {% set entity = row.entity %}
    <a href="{{ path('my_route', {'id': entity.id }) }}">Show my entity</a>
{% endblock %}

Source: Cell rendering

qferr avatar Nov 09 '16 10:11 qferr

Can we close this?

DonCallisto avatar Apr 16 '17 10:04 DonCallisto