flex datagrid autoscrolling - apache-flex

I am showing the web service data into flex application using datgrid.
I need to show this data scrolling automatically in continuous manner.
Anyone knows how to do this stuff?

Assuming you don't need to dynamically get the data once a certain scroll position is reached, you just need to update the verticalScrollPosition property.
Check out Creating an auto-scrolling DataGrid control in Flex on FlexExamples, I think that's exactly what you're asking.
If you had a dataset that was 100 items and wanted to tween it down to the last one, using TweenMax, you could do something like (though I'm not sure exactly how the datagrid gets the max scroll position:
TweenMax.to(dataGrid, 1, {verticalScrollPosition:dataGrid.maxVerticalScrollPosition});
Hope that helps!

Related

Lightswitch - Grid inside another Grid

Tell me please if I can put small grid (subform in Access terms) inside big grid and make them both editable.
I cannot show you screenshots because of not enough reputation
Well, I've managed myself. Just added new Datagrid in parent DataGrid Row. But I have another question now - how to hide headers in this child datagrid? I have search box that I do not need, and a counter in the bottom :(
I think you're gonna have to make a custom control if you don't want the data grid column headers.
Instead, have you looked at the List-Details screen? It might not be the layout you're looking for, but it might work for you.

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.

Unable to change the column width dynamically in flex datagrid

It's very very frustrating. I am using a singleton class (popup, which means it doesn't forget the last used variables) which contains a datagrid. I am making various columns visible/invisible, setting the widths and headers in accordance to data received from a database call. Everything works fine except that when I put the breakpoints before and after the point where I change width of columns, I do not see the change in width of datagrid at all! Instead I see some values totally out of sync as widths of datagrid column! However, since it is a singleton class, the next time I call this popup, I see widths which I did set up in last call.
I must be messing up in calling the setWidth() function (which is my custom function which changes the width of datagrid in action script). What should be the point where I should call this function? I tried in creationComplete, show and in the setter of dataprovider. Doesn't help...
I have kept horizontal scroll policy as 'off' (turning it on totally messes it up).
If I do datagrid.validateNow(), it doesn't help! And why the hell I don't see the width change reflected immediately if I put the breakpoints before and after the change. Somebody please advise me about what I am doing wrong here.
Thanks.
First of all you are indicating yourself what might be wrong here.
1) When you update the width when the component is visible => no change
2) When you close the popup and reopen this it is ok, this also means that the item has been re-rendered whereas it was not the first time. This means that you indeed have to try and trigger this yourself.
Here are some usefull links concerning flex component lifecycle. These should help you figure out which methods to call and / or override.
http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/
http://www.slideshare.net/rjowen/adobe-flex-component-lifecycle-presentation
Furthermore, you should never call validateNow() directly, but use invalidation methods instead.
I guess in this case you need to trigger the measurement of your component so a call to
invalidateSize() should do just fine.
Cheers
The key is to set the horizontalScrollPolicy="on" before you set the widths. See
fixed row width in DataGrid quirk
or Flex 3 DataGrid Column Width Problem

buttons in a datagrid in flex

i am using a data grid in flex and i am generating data from a mysql server. However, my problem is with adding a button within the datagrid so each row has one.
i have set the columns itemRenderer to mx.controls.Button although with the buttons shown in the grid there is no label on them (even though one has been set) and the assigned click event does not trigger when hitting the button. anyone have any ideas or guidance on what i am doing wrong.
Thanks
Mark
Not to worry I have sorted it. anyone with a similar issue i suggest reading this
http://www.axelscript.com/2008/02/29/using-the-itemrenderer-with-a-datagrid-in-flex/
an excellent source.

Flex collapsible field group control

I am trying to make a side panel in a Flex application that would hold a bunch of properties of a selected object. The number of properties may become huge, but they all fall into some certain categories.
For that, I am looking for a flex control that would be like a collapsible field group. Or like an accordion that can have multiple open panels at a time. Do you know, where can I get one?
UPDATE: I want something like the second example on the following page: http://extjs.com/deploy/dev/examples/form/dynamic.html
Thanks,
Artem.
http://www.flexdownloads.com/#view=detail;vstr1=19
is what you are looking for.
It sounds to me like you are looking for some sort of tree component. Flex actually has one of those and you should probably take a look at it.
This is a good link to see what controls are included in flex http://examples.adobe.com/flex3/componentexplorer/explorer.html

Resources