Add 'data-uuid' attr for mobile grid list items, if applicable
This commit is contained in:
parent
09ffdba9ef
commit
5afa832684
|
@ -964,7 +964,10 @@ class CustomWebhelpersGrid(webhelpers2_grid.Grid):
|
|||
value = self.get_column_value(column_number, i, record, column_name)
|
||||
if self.mobile:
|
||||
url = self.url_generator(record, i)
|
||||
return HTML.tag('li', tags.link_to(value, url))
|
||||
attrs = {}
|
||||
if hasattr(record, 'uuid'):
|
||||
attrs['data_uuid'] = record.uuid
|
||||
return HTML.tag('li', tags.link_to(value, url), **attrs)
|
||||
if self.linked_columns and column_name in self.linked_columns:
|
||||
url = self.url_generator(record, i)
|
||||
value = tags.link_to(value, url)
|
||||
|
|
Loading…
Reference in a new issue