flask-admin icon indicating copy to clipboard operation
flask-admin copied to clipboard

add column_extra_row_actions in fileadmin view

Open sebastianhenaosanta opened this issue 4 years ago • 0 comments

This is not an issue this is more like a question, i'm working with file admin and i want to add an column_extra_row_actions, i have tried that using the following code:

class MyView(FileAdmin): can_upload = False can_delete = True can_mkdir = False column_extra_row_actions = [ EndpointLinkRowAction('glyphicon glyphicon-play','') ]

file_admin_view = MyView('/home/pi/Desktop/projects/', url = '/' , name='Projects')

admin = Admin(app, name='projects', index_view = file_admin_view, template_mode='bootstrap3')

but i haven't had success. do you know what am i doing wrong? what's is the correct way to do this?, i have fallowed the documentation and i have found this:

from flask_admin.model.template import EndpointLinkRowAction, LinkRowAction class MyModelView(BaseModelView): column_extra_row_actions = [ LinkRowAction('glyphicon glyphicon-off', 'http://direct.link/?id={row_ ˓→id}'), EndpointLinkRowAction('glyphicon glyphicon-test', 'my_view.index_view ˓→') ]

but i don't know if this methodology also works with fileadmin view. What i understand is that BaseModelView is for database model view modification, but i'm not sure if it also works with fileadmin view.

Thanks

sebastianhenaosanta avatar Feb 23 '22 15:02 sebastianhenaosanta