New object type IMG VIDEO AUDIO
New object type IMG VIDEO AUDIO
Dear DataTables Developers, Allan!
I feel pleasure and real buzz more and more understanding the flexibility and power of DataTables mechanisms. Thanks!
I want to prepare 3 types of objects - picture, audio and video, which will be displayed in the table row in the corresponding DIV.
Please tell me
1) How to correctly pass the URL value in the fields block from the database, which corresponds to the object, in order to apply it in the HTML Tag template with the src = "" value.
2) I would like to turn off Label output to use the entire table width for the object. Of course it is possible to break this through CSS, but perhaps there is a better way?
Parsed in detail and ran the example at the link:
https://editor.datatables.net/examples/plug-ins/fieldPlugin.html
With deep respect,
Andrey
This question has an accepted answers - jump to answer
Answers
Hi Andrey,
1) Do you mean you have an id (or whatever) for the video and you need to output it in the DataTable with a
<video>
tag? If so, use a renderer for that. I’m not sure how well a DataTable with videos in each row will work from a UX point of view though.2) Do you mean inside the Editor form? If so, then yes, CSS is how this would be done. See also this example which shows an example of how you can change the CSS.
Allan
Allan,
Thanks for the answer. I will slightly correct the question on the first point. I have a code as below (from example). In the template of which for the object - the Video tag, I want to set values through the attributes.
something like this:
The video link itself is stored in the SRC column and the name is passed, which is saved by the typical mechanism when loading the file using this code:
I just want to take this name and substitute it into the SRC, taking into account additional attributes.
Only the file itself with my class, not the upload form.
Please tell me how to do it right?
Thanks!
With respect,
Andrey
Hi Audrey,
Thanks for the clarification. The
conf
parameter that is passed into the plug-in functions is the original object used to define the field. So you could doconf.src_def
to access that parameter.Allan
Allan,
Thank you. Thanks!
With respect,
Andrew, but not Audrey