File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -387,9 +387,22 @@ events:
387
387
- name : movestart
388
388
summary : Fired when a list row has started moving.
389
389
description : |
390
- This property can be used to change the UI once a new drag-and-drop interaction starts.
390
+ This event can be used to change the UI once a new drag-and-drop interaction starts.
391
+ The event properties are available in Titanium SDK 12.0.0+
391
392
since : " 11.1.0"
392
393
platforms : [android, iphone, ipad, macos]
394
+ properties :
395
+ - name : section
396
+ summary : List section from which the item is moved.
397
+ type : Titanium.UI.ListSection
398
+
399
+ - name : sectionIndex
400
+ summary : section index of the reference item.
401
+ type : Number
402
+
403
+ - name : itemIndex
404
+ summary : section item index of the reference item.
405
+ type : Number
393
406
394
407
- name : moveend
395
408
summary : Fired when a list row has ended moving.
Original file line number Diff line number Diff line change @@ -1108,7 +1108,21 @@ - (BOOL)canMoveRowAtIndexPath:(NSIndexPath *)indexPath
1108
1108
UIDragItem *dragItem = [[UIDragItem alloc ] initWithItemProvider: itemProvider];
1109
1109
dragItem.localObject = identifier;
1110
1110
1111
- [[self proxy ] fireEvent: @" movestart" ];
1111
+ // Fire an event to react to the move start
1112
+ NSIndexPath *realIndexPath = [self pathForSearchPath: indexPath];
1113
+ TiUIListSectionProxy *theSection = [[self .listViewProxy sectionForIndex: realIndexPath.section] retain ];
1114
+ NSDictionary *theItem = [[theSection itemAtIndex: realIndexPath.row] retain ];
1115
+ NSMutableDictionary *eventObject = [[NSMutableDictionary alloc ] initWithObjectsAndKeys:
1116
+ theSection, @" section" ,
1117
+ NUMINTEGER (realIndexPath.section), @" sectionIndex" ,
1118
+ NUMINTEGER (realIndexPath.row), @" itemIndex" ,
1119
+ nil ];
1120
+
1121
+ [[self proxy ] fireEvent: @" movestart" withObject: eventObject];
1122
+
1123
+ [eventObject release ];
1124
+ [theItem release ];
1125
+ [theSection release ];
1112
1126
1113
1127
return @[ dragItem ];
1114
1128
}
You can’t perform that action at this time.
0 commit comments