How to have different rendering data between Editor and Datatable ?
How to have different rendering data between Editor and Datatable ?
smassot
Posts: 28Questions: 9Answers: 1
in DataTables
Hello,
I try to find a way for having different rendering between Editor and Datatable view.
In my data, I have some variables which are id's of another data (join), so in Editor I have to use the id's value and in datatable use a string value with a left join. could you help me please ?
for example :
in Datatable : Pending
in Editor : 4 (4 is the Id for Pending in another table)
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
Have you had a look at the join examples, for example this one which show a "label" in the table and Editor edits a different value. If I understand correctly, that sounds like what you are looking for.
Regards,
Allan
Hi Allan,
I had to explain that I didn't use your JSON API because I have a sub select to do in my SQL request. So here is an example of data values read :
as you could see for example 'profession_exercee: 21' where 21 is the ID in profession SQLTable for giving the real name of profession like 'Teacher', I had to store this value after editing, so I have do this :
and it works perfectly but I tried to have the real name in datatable view and it seems that Editor didn't load from json value but load what we have in datatable view.
To have the real name in datatable view, I use arrays in my TWIG view like this :
Please forgive me for my bad english, hope you could help me in this case.
Thanks a lot.
It's ok with your example, I did it !, thanks a lot Allan for your support.