define self button on table row by privilege

define self button on table row by privilege

ondrusuondrusu Posts: 2Questions: 1Answers: 0
edited August 2016 in Free community support

Hello, I have one question.
Use DataTables in Nette Framework (and Doctrine 2)
I have define ajax table and I need define self button on table row, but I want this to be rendered by any conditions for example:
in latte template:
{if $user->allowed('edit')}
DataTables can it or How should I do, I dont know?
Can you help me??
Thank you.
PS: I hope, you understand me, sorry my english is very bad.

Answers

  • allanallan Posts: 63,812Questions: 1Answers: 10,516 Site admin

    Use columns.defaultContent if your button is static (i.e. doesn't depend on the data in the row), or use columns.render if the button does depend on the data in the row.

    You would then optionally include that column using your if statement (or you could optionally hide it using columns.visible.

    Allan

  • ondrusuondrusu Posts: 2Questions: 1Answers: 0

    Thank you, I try it.

This discussion has been closed.