Yes, xray does that with it's property inspector (datagrid) - based on the property type (string, boolean, _currentframe etc) it brings up a specific state that has specific tools for editing.

I created a getData method, that receives the event object from the clickHandler:

private static function getData(event:Object):Object
{
    lastDataGridRow = event.rowIndex;
    var row:Number = event.rowIndex - 1;
    var data:Object = app.propertyInspector.dataProvider;
   
    var obj:Object = {};
    obj.prop = data[row].property;
    obj.value = data[row].value;
    obj.path = data[row].path;
    obj.type = data[row].type;
    obj.objectType = data[row].objectType;
   
    return obj;
}

after having that data, you can use s switch statement to decide on the "state" you want to call

app.currentState = "stateName";

hth,

JG

On 6/4/06, jeremy lu <[EMAIL PROTECTED]> wrote:

there can be multiple view states inside the itemEditro/Renderer, so why not use a if else clause inside data() then switch to difference states ?

psudo code:

override public function data( o ){
    if(o.editor == "richText"){
       currentState = "richTextEditor";
    else{
       currentState = "defaultButton";
    }
}



On 6/5/06, Graham Weldon < [EMAIL PROTECTED]> wrote:
Hi all,

Just wondering if anyone has managed to create a unique or different
itemEditor in a Datagrid based on the row its in?
More specifically, I would like to choose the itemEditor based on some
of the model XML:

    <element name="Hello" id="12" editor="richText"/>

In this sample, the itemEditor would show a button "edit" that would
launch a rich text editor, but the next row might be a simple text input.
Any suggestions would be helpful.

Regards,
Graham Weldon



------------------------ Yahoo! Groups Sponsor --------------------~-->
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links

<*> To visit your group on the web, go to:
<*> 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 Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
John Grden - Blitz

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to