Note that there are some explanatory texts on larger screens.

plurals
  1. PODrag and drop in dataGrid, custom cursor during drag not working (self answered, new question for the bounty)
    text
    copied!<p><strong>EDIT 12/21/09, End of the day:</strong><br> I have managed to answer my own question so my bounty rep is lost to me :-( Anyway since my answer solves my problem I will award the bounty to anyone that can answer this. My solution uses AS to remove the the rollOut/rollOver while a user is dragging. In a dataGrid. How can you get the same result without removing the rollOut/rollOver (so that rollOut is not firing for each item as you drag another item over it)?</p> <p><strong>Original Question</strong><br> I have a datagrid that I want the user to sort the rows on. To make it obvious that it's sortable I am implementing some custom cursors. But I'm having a problem when I actually drag an item. Can anyone help me out?</p> <p>Thanks</p> <p>here's a psuedo demonstration of the problem</p> <p>Application = normal cursor // fine</p> <p>Rollover datagrid = open hand cursor // good so far</p> <p>mousedown on datagrid = closed hand cursor // good</p> <p>dragging item around = closed hand cursor // switches back to normal cursor (if I move it around real fast I can see my custom curser for an instant)</p> <p>mouse up on datadrid = open hand cursor // not sure, after I drop it goes back to open hand but if I mouse down, dont move and mouse up I have a closed hand</p> <p>rollout of datagrid = normal cursor //good</p> <p>datagrid code:</p> <pre><code>&lt;mx:DataGrid id="sectQuestionsDG" x="10" y="204" width="558" height="277" headerHeight="0" selectable="{editMode}" dragMoveEnabled="{editMode}" dragEnabled="{editMode}" dropEnabled="{editMode}" dragDrop="sectQuestReOrder(event);" rollOver="over();" mouseDown="down();" mouseUp="up();" rollOut="out();"/&gt; </code></pre> <p>functions:</p> <pre><code>public function over():void{ CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0); } public function down():void{ CursorManager.setCursor(grabbingCursor,CursorManagerPriority.HIGH,0,0); } public function up():void{ CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,0,0); } public function out():void{ CursorManager.removeAllCursors(); } </code></pre> <p><b>Edit 12/17/09:</b> I've made a little bit of progress, I'm now doing this on rollOver </p> <pre><code>var styleSheet:CSSStyleDeclaration = StyleManager.getStyleDeclaration("DragManager"); styleSheet.setStyle("moveCursor", grabbingCursor); CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW); </code></pre> <p>This is giving me the correct rollover and correct drag, but if I try to add any function to rollOut it screws up again, so now I'm stuck with the grabCursor. It seems like when I set a rollOut on the dataGrid it's firing for each row, same with mouseOut, is there any way to avoid that?</p> <p><b>Edit 12/21/09:</b> It is a confirmed thing that roll/mouse out/over fire for every item in the datagrid. The solution I need is how to prevent that and only fire it when the user mouses out of the datagrid as a whole. I need flex to see the forest, not the trees.</p> <p>PS. the rollout only fires on every item when I am dragging. mouseout fires on every item regardless</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload