in Technology

Flex Datagrid Editing

If somebody has a simple solution to this, do let me know!

My head is currently spinning trying to figure out how to make an editable datagrid in Flex 2 Alpha 1. All the examples of this show a datagrid, a collection of text boxes and a few buttons. Selecting an item in the DataGrid will bind the value with the TextInput. (Which happens via the cellEditor routine I believe). You change the value in Text box, and click Update and it goes to the DataGrid.

I don’t want such round trips. Can’t we simply do inline editing and update the dataProvider right there? And, how about sending this to the backend for an actual update? Flash’s RDBMSResolver was a great thing, is there anything like that on Flex yet?

If I write my on cellEndEdit event handler, I get some strange errors of 0 being out of bound.
RangeError: Index '0' specified is out of bounds
at mx.collections::ListCollectionView/getItemAt()
at mx.collections::ListCollectionView/
http://www.macromedia.com/2005/actionscript/flash/
proxy::getProperty()

I couldn’t find many answers to these questions, and am hoping I get something soon!

Write a Comment

Comment

  1. Ok, got it finally! Used the cellFocusOut event, made a variable bindable, set data, passed it to the web service, and it was done! Not sure if this is the best way to do it, but at this stage, it’s enough!

    🙂

  2. The latest is that we dropped in place editing for the data grid. After trying out various things, we figured it was not reliable. Had too many problems, and hence went with the standard approach of having a set of text fields in which data will be populated on select of a row in grid. Edited in the text field and then sent to the backend!

    It’s sad! I know!

  3. Hi, i saw u r post , what exactly i want is datagrid should have a edit button as an renderer when i click on this it should focus on this row and only items in that row should be editable