benbjohnson / melomel

External ActionScript Interface.
https://github.com/benbjohnson/melomel/wiki
Other
42 stars 8 forks source link

Spark DataGrid gridClick won't raise #52

Open ghost opened 11 years ago

ghost commented 11 years ago

Hello, I recently tried out your library for Flex acceptance testing using Cucumber, and so far I love it. Having a small problem, though, if you can help (I see not a lot of activity happens here anymore):

I've tried to register a gridClick on a Spark DataGrid to have a renderer popup a Callout, but the first index only ever gets selected. The Callout never raises because a gridClick event never raised.

How may I get this to operate as if a user clicked on the first item in the DataGrid?

EDIT: Also, I apologise, I should have asked this on the mailing list, not on this issues page.

benbjohnson commented 11 years ago

@dakhath To be honest, I haven't really worked on this project for the last 3 years so take my answer with a grain of salt. The easiest thing to do is to make static function (clickGridRow(index:int)) on a class (e.g. MyTestHelper) in your code that does the functionality you want and then just call it from Melomel:

Melomel.get_class("MyTestHelper").clickGridRow(0)
ghost commented 11 years ago

That sounds reasonable, considering. Thank you for such a quick response! I'll check that out immediately.

ghost commented 11 years ago

Finally got back around to this. Can't seem to cause the item renderer to popup on GridEvent.GRID_CLICK for the first row. Selecting a row will display properly, however. Have I dispatched the wrong event?

Also, may I access your mailing list through Google Groups?

benbjohnson commented 11 years ago

@dakhath The mailing list is just on librelist. There hasn't been any chatter for a while so I'm not sure who all is on there still. You could probably post the issue to a general Flex list though since it sounds like it's a Flex event dispatching issue.

ghost commented 11 years ago

Likely. Thank you very much! I'll comment here once someone resolves the issue there or on another mailing list, just in case anyone else has this problem.

ghost commented 11 years ago

Turns out the itemRenderer handled the GRID_CLICK event, not the Spark DataGrid, so I defined the step to Melomel.click on the renderer where the :rowIndex => 0.

Not quite as portable of a solution, but it works. Sorry about all of the confusion!