Add 'target' kwarg for grid action links
For opening link in new window etc.
This commit is contained in:
		
							parent
							
								
									7104e275c3
								
							
						
					
					
						commit
						709fd5200d
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -611,7 +611,7 @@ class Grid(object): | |||
|         """ | ||||
|         url = action.get_url(row, i) | ||||
|         if url: | ||||
|             kwargs = {'class_': action.key} | ||||
|             kwargs = {'class_': action.key, 'target': action.target} | ||||
|             if action.icon: | ||||
|                 icon = HTML.tag('span', class_='ui-icon ui-icon-{}'.format(action.icon)) | ||||
|                 return tags.link_to(icon + action.label, url, **kwargs) | ||||
|  | @ -707,11 +707,12 @@ class GridAction(object): | |||
|     'actions' column when rendering the grid. | ||||
|     """ | ||||
| 
 | ||||
|     def __init__(self, key, label=None, url='#', icon=None): | ||||
|     def __init__(self, key, label=None, url='#', icon=None, target=None): | ||||
|         self.key = key | ||||
|         self.label = label or prettify(key) | ||||
|         self.icon = icon | ||||
|         self.url = url | ||||
|         self.target = target | ||||
| 
 | ||||
|     def get_url(self, row, i): | ||||
|         """ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar