Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-17-2010, 08:41 PM   #1
westony
Registered User
 
Join Date: May 2009
Posts: 12
Default How can I clear a DataGrid

My whole Idea is to make REFRESH for my DG, i wanna clear it and then to load the dataProvider...

How can i Clear the DataGrid ?


Thanks in advance!
westony is offline   Reply With Quote
Old 12-17-2010, 11:12 PM   #2
drkstr
Flexpert
 
drkstr's Avatar
 
Join Date: Sep 2006
Location: Seattle, WA: USA
Posts: 1,587
Default

You can just set the dataProvider again.
drkstr is offline   Reply With Quote
Old 12-18-2010, 06:12 AM   #3
westony
Registered User
 
Join Date: May 2009
Posts: 12
Default

I tried, but I have imagerenderer on one of the datafiled as class and its getting bugged when i do that. If i close the window and reopen it again everything is fine!

See this:
http: //img196.imageshack.us/img196/977/29544197.png
http: //img573.imageshack.us/img573/8310/27297576.png

Those images are powered by:
Code:
package
{
	import mx.containers.HBox;
	import mx.controls.Image;
	import mx.controls.Label;
	import mx.controls.dataGridClasses.*;
	
	public class ImageRenderer extends HBox
	{
		private var imageReference:Image = null;
		private var img:Image = new Image();
		private var lbl:Label = new Label();
		
		
		override public function set data(value:Object):void
		{
			if(value != null && imageReference == null)
			{
					if(value.read == false) {
						img.source = "img/assets/newmail.png";
						img.toolTip = "New Mail";
					}
					else
					{
						img.source = "img/assets/oldmail.png";
						img.toolTip = "Old Mail";
					}
			}
				
				addChild(img);
				imageReference = img;
				setStyle("verticalAlign", "middle");
				setStyle("paddingLeft","2");
				
			
			
			
		}
		
	}
}

Last edited by westony; 12-18-2010 at 09:14 AM.
westony is offline   Reply With Quote
Old 12-18-2010, 02:20 PM   #4
westony
Registered User
 
Join Date: May 2009
Posts: 12
Default

Fixed By Adding one more if the same but with imageReferance != null
westony is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:00 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.