[openstack-dev] [horizon] Passing multiple values in table.Column in Horizon DataTable

Julie Pichon jpichon at redhat.com
Mon Oct 20 09:26:29 UTC 2014


On 19/10/14 12:52, Rajdeep Dua wrote:
> Hi,
> I need to pass two values in the link generated from the table.Column as
> shown below.
> 
> 
> class DatasourcesTablesTable(tables.DataTable):
>     data_source = tables.Column("column1", verbose_name=_("Column1"))
>     id = tables.Column("id", verbose_name=_("ID"),
>                        link="horizon:admin:path1:path2:rows_table" )
> 
>  The existing link gets value of "id" in kwargs
> Also need to pass value of "column1".
> 
> Any pointers on how this can be done would be helpful

You should be able to do this by calling to a function instead of
hardcoding the link directly. That'll give you the flexibility to use
whatever attributes you want for building up the url. You can see an
example in the EventsTable on the stacks panel [1] on the
logical_resource column.

Hope this helps,

Julie

[1]
https://github.com/openstack/horizon/blob/2a9349bd67/openstack_dashboard/dashboards/project/stacks/tables.py#L131

> Thanks
> Rajdeep
> 
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 




More information about the OpenStack-dev mailing list