[openstack-dev] Display images/icon in Horizon Tables

Lyle, David david.lyle at hp.com
Thu Mar 20 15:45:43 UTC 2014


This is easy to accomplish by creating a custom template for a cell.  In your table, instead of providing a data field for the column, provide a method name, have that method load a custom HTML template.

Here is an example of this without an image of this method: https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/instances/tables.py#L653

But adding an <img> in the HTML template works fine.

David

From: Dave Johnston [mailto:Dave.Johnston at owmobility.com] 
Sent: Thursday, March 20, 2014 9:20 AM
To: openstack-dev at lists.openstack.org
Subject: [openstack-dev] Display images/icon in Horizon Tables

​Hi,

I'm creating a custom panel for horizon.  I have developed a table that displays some information, and I would like to add a 'icon' to each row.  
Ideally, I want to be able to specify the URL of a remote image, and have it displayed using the <img> tag.

Can this be acheived with filters, or some other mechanism ?




More information about the OpenStack-dev mailing list