Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Jsonize colored GridCtrl 
	
		
		
			| Jsonize colored GridCtrl [message #36775] | 
			Tue, 03 July 2012 16:54   | 
		 
		
			
				
				
				  | 
					
						  
						koldo
						 Messages: 3453 Registered: August 2008 
						
					 | 
					Senior Veteran  | 
					 | 
		 
		 
	 | 
 
	
		Hello Daniel 
 
Now it is got a runtime error when trying to Jsonize a GridCtrl with colored cells with AttrText. 
 
A solution to this would be changing Vector< Vector<Value> > GridCtrl::GetValues(). 
 
Before: 
		for(int j = 0; j < cols_cnt; j++)
			v[i][j] = items[i + fixed_rows][j + fixed_cols].val;  
 
After: 
		for(int j = 0; j < cols_cnt; j++) {
			Value &val = items[i + fixed_rows][j + fixed_cols].val;
			if(IsType<AttrText>(val)) {
				const AttrText& t = ValueTo<AttrText>(val);
				v[i][j] = t.text;
			} else 
				v[i][j] = val;
		} 
		
		
  Best regards 
Iñaki
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 08:41:14 CET 2025 
 Total time taken to generate the page: 0.04814 seconds 
 |