Re: [flexcoders] Re: Datagrids and Images

2005-04-11 Thread Manish Jethani

On Apr 11, 2005 3:34 AM, digital_eyezed [EMAIL PROTECTED] wrote:

 Sorry I can't see how this helps, this shows how to drag and drop
 columns on a datagrid, which is not the same as having an icon in the

Okay, I thought you didn't know about header renderers, so I pointed
you to that example.  It turns out you already have a header
renderer...

 import mx.controls.Label;
 class refreshRenderer extends mx.controls.Label{
var lbl : MovieClip;
var listOwner : MovieClip; //Reference to the parent DataGrid.

If you want an icon, make the renderer based on a HBox instead of a
Label, and put an Image and a Label in there.  (BTW, why are you
creating a label inside a label?)

-- 
[EMAIL PROTECTED]
http://manish.revise.org/


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Datagrids and Images

2005-04-10 Thread digital_eyezed


Great thanks,

I've done that now, however, what about in the header, can I use a 
headerRenderer to show an Icon in the header? The documentation 
doesn't show this as being possible.

I can show a tooltip in the header but what about images?

Cheers,

Iain

--- In flexcoders@yahoogroups.com, Abdul Qabiz [EMAIL PROTECTED] wrote:
 Hi,
 
 It's simple, you can create a simple custom cellrenderer for 
datagrid column
 which would show image based on column/cell value.
 
 Look at docs here:
 http://livedocs.macromedia.com/flex/15/flex_docs_en/0527.htm
 
 If you still have any queries, ask here..
 
 -abdul
 
  
 
 -Original Message-
 From: digital_eyezed [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, April 10, 2005 11:03 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Datagrids and Images
 
 
 
 Hi,
 
 I have a datagrid which is populated by a result from a remote 
object 
 (an array of value objects), one of the value object attributes is 
a 
 boolean. I want to show an image if the boolean is true in the 
 datagrid, is this possible.
 
 e.g.
 
 Name, age, genger are the elements of the value object, where 
gender 
 is true or false. If gender is true then I show a male symbol
 (image), 
 else show a female symbol(image).
 
 Normally a simple embedded if statement would have been able to
 tackle 
 this, but as the datagrid is populated by the dataProvider tag I
 can't 
 see how to create this logic. Maybe I have to use a custom 
component 
 or a reapeater tag.
 
 Thanks,
 
 Iain
 
 
 
 
 
  
 Yahoo! Groups Links





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] Re: Datagrids and Images

2005-04-10 Thread Manish Jethani

On Apr 11, 2005 1:59 AM, digital_eyezed [EMAIL PROTECTED] wrote:

 I've done that now, however, what about in the header, can I use a
 headerRenderer to show an Icon in the header? The documentation
 doesn't show this as being possible.

You can use a custom header renderer.  See this example in which I've
created a custom header renderer:
http://manish.revise.org/flash/flex/ReorderableHeaderRenderer.zip

-- 
[EMAIL PROTECTED]
http://manish.revise.org/


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Datagrids and Images

2005-04-10 Thread digital_eyezed


Sorry I can't see how this helps, this shows how to drag and drop 
columns on a datagrid, which is not the same as having an icon in the 
column header. All I want to do is put an icon in the header of each 
column on the datagrid, however as you can see from this renderer 
class I can show a tooltip and have the text set to R, but I really 
want to show a little fork and knife icon instead of having an 'R', 
and a tooltip.

import mx.controls.Label;
class refreshRenderer extends mx.controls.Label{
   var lbl : MovieClip;
   var listOwner : MovieClip; //Reference to the parent DataGrid.

   function myRenderer(){
   }
   public function createChildren():Void {
  lbl = createClassObject(Label, 'label', 1, {toolTip: 'Are there 
refreshment facilities?'});
  lbl.text = R;
   }

   public function getPreferredHeight():Number {
  return listOwner.rowHeight;
   }

   public function layoutChildren():Void {
  lbl.setSize(18, listOwner.rowHeight);
   }

   function setValue(str:String, item:Object, sel:Boolean) : Void {
   }
}

--- In flexcoders@yahoogroups.com, Manish Jethani 
[EMAIL PROTECTED] wrote:
 On Apr 11, 2005 1:59 AM, digital_eyezed [EMAIL PROTECTED] wrote:
 
  I've done that now, however, what about in the header, can I use a
  headerRenderer to show an Icon in the header? The documentation
  doesn't show this as being possible.
 
 You can use a custom header renderer.  See this example in which
I've
 created a custom header renderer:
 http://manish.revise.org/flash/flex/ReorderableHeaderRenderer.zip
 
 -- 
 [EMAIL PROTECTED]
 http://manish.revise.org/





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/