Some modifications on Christophe Coenraets ORM Example
February 10th, 2009
In addition to Christophe Coenraets article “Using the SQLite Database Access API in AIR Part 3″ I made some modifications to enable inline editing and update the grid imidiately after every data change.
import mx.events.DataGridEvent;
private var em:EntityManager = EntityManager.getInstance();
public function saveItem():void
{
em.save(contact);
parentApplication.loadContacts();
}
public function saveItemInline(event:DataGridEvent):void
{
var field:String = event.dataField;
contact[field] = event.currentTarget.itemEditorInstance.text;
em.save(contact);
}
public function deleteItem():void
{
em.remove(contact);
parentApplication.loadContacts();
}
public function newItem():void
{
contact = new Contact();
}











Hi Stevie,
my changes are more in the EntityManager code. I will setup a google code project, clean up my code and commit everything. I sorry that i have so less time.
Hi Odo,
I think this is a good Idea and will follow up :-). Please let me know if the google code page is available.
c u st.
I am interested in this project also. I think building ontop of this will be very interesting.
this is exactly the post I needed to see!
Great article. Thanks for the great resource.
Hi Stevie
This might be a longshot…I am trying to insert everything into a datagrid, are there any examples out there with this type of approach
@Jeroen
Hi, I did it with my rss reader ( http://werth.psycholutions.com/latest-project ) Unfortunately that code is’nt public ;-). Meanwhile there could be some more resources…I would test a google search.
@ Stevie I did do a public search on google and come up with nothing..it seems to be like hens teeth trying to find a example on this particular topic.
Well, to soon to say if it’s good, but at least it’s well designed.
I mean I thought I would be blocked after adding some interests, but the site helps you to add more.
Cheers
Great article, again. These informations are especially useful …