Edit, delete and what about VIEW ???
Edit, delete and what about VIEW ???
lifedaniel
Posts: 68Questions: 4Answers: 0
Hello, I have some tables that have like 20 columns, so I would like to know if it's possible to just show in the datatable 5-6 columns, and then have a "view" option like the edit or delete, that open a modal with the read only mode ? And just an exit button.
Thank you
This discussion has been closed.
Replies
Hi,
there is https://datatables.net/extensions/colvis/
Enable the view of your def columns, and through ColVis users can choose which columns view.
That's not what I need, I need an option View right to the delete and edit that open a Modal with the informations and an exit button. Thank you anyway
With editor (server side)
Maybe are you looking for this: https://datatables.net/examples/api/row_details.html
Show your 5/6 columns and on the click systems shows extra info
i would suggest if your going to use what cirora mention u could use
http://editor.datatables.net/examples/simple/responsive.html
so that even if you show 20+ column it would automatically generate a row details below that row..
also if you really insist on wht you want u could just create a new var editor2; and
do it like this:
and for the button
thou i don't now how to remove the update button in the editor :(
There is an example available on the Editor site showing how to can have data shown in the form only: http://editor.datatables.net/examples/advanced/formOnlyData.html .
Equally, you could also have data in the table only if you so wished!
Allan
The way xain819 did it looks pretty fine and that's what I kinda need. But I need to remove the "update bottom" and the bottom, and if possible, change the INPUT(read only) by just a text.
Is it possible?
Apologies - I misread your question before, so my reply probably wasn't too helpful before!
Set the
buttons()
option to be an empty array, or perhaps have a Close button that callsclose()
.I think a field type plug-in would probably be the best option there. There is once that is already available for this: https://editor.datatables.net/plug-ins/field-type/editor.display .
I should say that having a built in view option is on the to-do list for Editor.
Allan
DO you have an exemple to remove the update bottom and change the texts of the header for the editor2 ??
I think you should be able to just call the
buttons()
function with an empty array - for example:editor.buttons( [] )
. There are a number of examples of how to use it in the documentation.Allan