Add row dynamically to AdvancedDataGrid - apache-flex

I would like to add new row on the fly (runtime) to my AdvancedDataGrid.
I can add it to the data model, but couldn’t find a way to make the table render and show the new row.
What i am seeking for is to create an effect of expandable item, where clicking on row will show "additional information" (like a drawer) and clicking on row expand button will reveal it's children.
I saw examples of this for dataGrid (http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html), but not for AdavancedDataGrid.
Only way I found to do this is to add a new child and use openItem, but this cause the other children to be visible as well.
Any help is greatly appreciated

you need to revalidate the whole datagrid after you added a new item, so that all the new elements can become visible.
yourDataGrid.validateNow();
This should help:)

Related

Focusing the Row to be added in Inline Mode

I am trying to add a new row to the ASPxGridView in the inline mode. What I want is, when I click the 'New' button I want the new row that I am going to add, to have the focus, that is, the row should be highlighted. How can I accomplish this?
I have tried ASPxGridView1.FocusedRowIndex = -1; inside the InitNewRow event, but it doesn't highlight the row.
Any suggestions?
This links might guide you :
http://www.devexpress.com/Support/Center/p/Q260744.aspx
http://www.devexpress.com/Support/Center/p/Q259550.aspx
http://www.devexpress.com/Support/Center/Question/Details/Q356961

How can I create a draganddrop wrapper inside a table row, that can represent the whole row

When I use treetable in Vaadin, it is working fine drag and drop the whole row when click the left and right blank ereas. but that is not user friendly, I wanna create a draggable layout inside the row, let's say the 1st component of the each row, that when clicking it, the whole row is selected and can be draged and dropped to reorder.
The thing is I can create a vertical layout with wrapper doing that, but drag mode is only for its component or the wrapper itself, and when doing the drag action, it doesn't actually showing the whole row is moving, which may confuse the clients. What can I do to make it looking like I am dragging the whole row, similar with the one you drag the blank area of each row? Thanks.
I'm afraid there currently is no way for adding a wrapper that would extend the entire row instead of just one cell. To do this you'd need to extend the client-side implementation of Table (VScrollTable) and this is not something I would recommend as it is quite complex.
I do think that what you describe should be possible in core Vaadin (without using drag & drop wrappers), so could you please file a ticket at dev.vaadin.com? And please attach a small application showing the problem to make it easier for us to see the problem and fix it.
Anyways, in order for you to get it working today I'd suggest that you change your UI design a bit and for example borrow drag handles from iOS. By this I mean that you could add an icon that suggests "draggable" as a background-image in the first cell (or in the row header cell of each row) that encourages the user to grab the row there, where it is "empty" and dragging works. This way the user might not be too confused if dragging only works reliably in some parts of the rows.

Focus back to datagrid column after editing in flex

How can I get back the focus to the column after editing datagrid by Keypress.Enter, so that I can move to another column using arrow keys. Now its stuck in the edited cell and I cant move to another column.
Thanks,
Rej
Use focusManager to setup focus of cell which should be presented inside of event.currentTarget
read next articles:
http://www.vaishalimistry.com/2005/12/15/set-focus-on-a-cell-in-datagrid-in-flex-20/
http://www.axelscript.com/2008/02/20/using-the-focusmanager-in-flex/

ListView Edit item Position

I have a Listview in my aspx page with Insert template and Edit template. and a Add New LinkButton.
When a user clicks on Add New LinkButton I am able to specify Insertitem Position so that the Insert TEmplate appears at the bottom of the listview. But how to I make the edititem template to appear at the bottom like the Inserttemplate
Its not available for the EditItemTemplate.
You'd have to actually save the original position, move the item in the data source itself (probably IList compatible), rebind the view, trigger editing on the new position, then swap the data item back to the original position.
I wouldn't recommend it. It's nonintuitive behaviour for users anyway; when I decide to edit something I should either be able to edit in place or edit on an entirely separate form. It's very rarely good UI design to shuffle items around while users are working on them, especially if you have any sort of scrolling/paging going on.

Flex datagrid control with expanding rows

I'm looking for a DataGrid with expandable rows implementation in Flex. I don't want to use Advanced DataGrid control because it's too slow and too complex.
The desired behavior is like this: when you click a row, a panel opens between the rows with some details and the rest of the rows are moved down, and when you click again the panel is closed and the rows are back to normal. If you click the other row, the one that was expanded collapses and the row you clicked is expanded.
You'll probably need to use a custom ItemEditor that responds to clicks and expands itself.
The variableRowHeight property may need to be set to true as well.
The behavior you are describing sounds an awful lot like an Accordion component, though that doesn't quite sound like what you are looking for. Another approach would be to use a List component with a custom itemRenderer that is expanded when in the selected (clicked) state, and collapsed when not selected.
We extended Flex Datagrid component and used custom item renderer for this. We actually expand one cell and resize it to cover all other cells in the same row. While this may be not the easiest solution it works and the Datagrid is very fast.

Resources