View Full Version : Editable Datagrid
mullaikani
08-08-2009, 08:54 AM
Hi
Can any one please tell me how to create a empty datagrid in editable mode??As for now i have created a empty array and assigned that as a dataprovider.
Thanks.
charlesshoults
08-11-2009, 11:30 PM
We might need a little more information. You have your dataGrid and presumably have set it as editable and have an arrayCollection that you've set as the dataProvider. The arrayCollection exists but has no rows therefore nothing displays in the dataGrid.
It depends on what you want to do with it and how much of an interface you want to create. In the most basic form, you could add a listener to the dataGrid that listens for a mouse click and adds a row of empty values. The newly created fields could then be edited by hand.
dataGrid.addEventListener(MouseEvent.CLICK, addRow);
private function addRow(evt:MouseEvent):void {
if(gridSource.length==0) {
gridSource.addItem({'title':"",'desc':"",'author':""});
}
}
Alternatively, you could create a series of buttons for add, delete, move up, move down and such that would perform equivalent tasks.
mullaikani
08-16-2009, 05:29 PM
My req is editing the empty datagrid without any dataprovider as i did by array.Your solution will do...
Thanks a lot for ur help.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.