1
votes

I have a flex mobile project. In my homeview I have a spark datagrid. The selectionMode is "singleCell". I have an eventlistener on the datagrid which listens to the selectionChange event. When someone clicks on a cell, a callout view is showed with a list.

Now when I want to scroll in the datagrid (if it has many rows), obviously the selectionChange event is triggered instead of the normal scrolling. Does anyone has a solution for this?

The curious thing is, when you use a list (in place of a spark datagrid) with a change event (spark.components.supportClasses.ListBase.change), the list is able to say the difference between scrolling and a selection without any issue!

1
I completely retagged this post; adding in the Adobe Flex tag; an removing Flex-Mobile b/c the Spark DataGrid is not available in Flex Mobile Apps and removing scrolling and events b/c they are very generic.JeffryHouser
@www.Flextras.com That's curious. I have a flex-mobile project and I do have a spark.components.DataGrid in my view. You can use the spark datagrid in flex mobile apps. Check your sources before editing my topic. I am not using a regular flex project. I am using a flex mobile project. I can show you a picture of a spark datagrid in my application running on my HTC Desire HD. Also I added the event and scrolling tag because it does resemble a part of the problem I encountered. I'd rather had some constructive feedback regarding the issue.Kim
From the docs on the Spark DataGrid. help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/… "Adobe recommends that you not use this component in an application that uses the mobileDevice profile." You can add other SWCs to mobile projects to get access to non-mobile optimized components. Perhaps that is what you've done. You'll probably have to modify, or extend, the DataGrid to get such things to work on mobile devices. I've done something similar for the DropDownList/ComboBox.JeffryHouser
You can use a spark datagrid without adding a SWC. It's standard available if you use the spark theme on a mobile project. Do you have any approach how I could solve this without a datagrid? You do have a point that it isn't optimized, however I don't need to consume much data in my datagrid.Kim
Interesting, it does come up in code hinting--even though it clearly says "not mobile optimized" in the code hints. It does not show up in the design view component list. In case you missed the edit to my last comment; You'll probably have to modify, or extend, the DataGrid to get scrolling to work on mobile devices. I've done something similar modifications for the DropDownList/ComboBox.JeffryHouser

1 Answers

0
votes

Correct, the issue is caused by the singleCell editmode @Al_Birdy.

I have semi-solved it by using a doubleclick event on the datagrid. The app will also be exported as a desktop application in the final stage so that isn't a real bad idea.

As www.Flextras.com pointed out, the datagrid is not yet optimized for mobile usage. If I may add something to that, it isn't that mature either. To solve this issue, basicly a likewise approach should be implemented like the list control has. In this control, this behaviour is implemented (the difference between a scroll event and a touch/click event). It kinda surprised me that the spark datagrid didn't had this behaviour. But then again it wouldn't surprise me they took the 'ol good desktop' component and ported it, which might explain everything.