Skip navigation
Currently Being Moderated

Editing datagrid using DropDown List

Nov 7, 2011 9:04 AM

I need to provide a list of choices for a user to select from in datagrid's column.

I am using classFactory to specify a class for the item Editor of that column. I am using startItemEditorSession to start editing session

and I am using  endItemEditorSession to end it. After I run endItemEditorSession the data in the column is shown as [object ListItem].

Do I need to have an item Renderer as well for this column? Because my understanding I dont need it.

 

Thanks

 
Replies
  • Currently Being Moderated
    Nov 7, 2011 9:25 AM   in reply to Zolotoj

    Yes, you'll need an item renderer to display the right field from your data for that column.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 7, 2011 11:20 AM   in reply to Zolotoj

    Actually, if I'm understanding you correctly, you just need to set the dataField correctly on the GridColumn. It looks like the item renderer just isn't getting the right field from the data to display

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 7, 2011 11:30 AM   in reply to Zolotoj

    what is your data object? Does data.df1.toString() return the right thing? I'd try this outside of the DataGrid to make sure.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 7, 2011 1:35 PM   in reply to Zolotoj

    Try putting a breakpoint on this line: <s:Label text="{data.FamhistRelationshipCode}"/>. When it breaks, examine what data.FamhistRelationshipCode using the debugger.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 7, 2011 2:22 PM   in reply to Zolotoj

    Can you create a simple test example?

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2011 6:01 AM   in reply to Zolotoj

    The first thing I see is that you don't need to create a sub-class of Column, the standard Column class should provide everything you need to specify an itemrenderer for the column. The other thing I would look at is your DropDownItemRenderer class. From the error you described it sounds like you didn't specify a labelFunction or labelField that tells the dropdown how to display the data.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points