View modal button
View modal button
I've been using Editor successfully for some time. When a row is created, I have many, many fields that are populated to insert into my db.
The rows that show up in Datatables only have a few fields displayed for a quick reference. Right now, I am using the standard add/edit/delete buttons to manipulate the data.
Is there a way to click a row, select a VIEW only button, have the full modal show in read only mode, for instance, to have a user just look at the fully populated form?
Right now, the user has to select a row and then click the edit button to see the fully populated form fields. It just doesn't seem to practical.
Thanks.
Replies
Hi,
Currently, no. A read only panel is something that I've thought about a number of times before, but have always held back because I think it is likely developers such as yourself would want to customise the layout of it to a much greater degree than Editor would make possible. At the moment it would just show a list of label / text values. That might be okay for you, but it does beg the question of how to make it flexible.
That said, you could use the display plug-in for Editor which would do what you are looking for. Just have a second Editor instance which uses all
display
field types and place that into edit mode for the "view". Its a bit of a workaround, but since nothing would actually be editable, that would visually be just the same for the end user.Another option might be to use something like Responsive to have it show the hidden details.
Or perhaps custom controlled child rows which gives you complete control over the display layout.
Regards,
Allan
Thanks, Allan.
I understand your concerns.
To me, if I'm entering the information using the prepared form from Editor, I would expect/want to see a 'view' only modal that looked like how I entered it.
Since I integrated the Editor and cannot (I'm assuming I can't) edit the layout of the entry form, I wouldn't expect to edit the layout of the view form either.
I appreciate your help. I'll look into the other options!
Is there a way to rename the EDIT button to something like 'VIEW/EDIT'. That actually would work. Just something extra to let a user know the full form will show to view which they can also edit.
buttons: [
{ extend: 'create', editor: editor_alternate },
{ extend: 'edit', editor: editor_alternate, text: 'View/Edit' },
{ extend: 'remove', editor: editor_alternate }
]
That works for me! Thanks!!
Yes - exactly like that!
Allan