Expose a way to embed "raw" data values within Buefy grid data
for sake of custom front-end stuff
This commit is contained in:
		
							parent
							
								
									3a53ffcc23
								
							
						
					
					
						commit
						b14e8daa1a
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
					@ -1124,8 +1124,17 @@ class Grid(object):
 | 
				
			||||||
            rowobj = raw_data[i]
 | 
					            rowobj = raw_data[i]
 | 
				
			||||||
            row = {}
 | 
					            row = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # sometimes we need to include some "raw" data columns in our
 | 
				
			||||||
 | 
					            # result set, even though the column is not displayed as part of
 | 
				
			||||||
 | 
					            # the grid.  this can be used for front-end editing of row data for
 | 
				
			||||||
 | 
					            # instance, when the "display" version is different than raw data.
 | 
				
			||||||
 | 
					            # here is the hack we use for that.
 | 
				
			||||||
 | 
					            columns = list(self.columns)
 | 
				
			||||||
 | 
					            if hasattr(self, 'buefy_data_columns'):
 | 
				
			||||||
 | 
					                columns.extend(self.buefy_data_columns)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # iterate over data fields
 | 
					            # iterate over data fields
 | 
				
			||||||
            for name in self.columns:
 | 
					            for name in columns:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # leverage configured rendering logic where applicable;
 | 
					                # leverage configured rendering logic where applicable;
 | 
				
			||||||
                # otherwise use "raw" data value as string
 | 
					                # otherwise use "raw" data value as string
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue