Feb 22, 2013, 8:37 PM
[CLOSED] Calling DirectMethod from drag drop
I'm having trouble calling a DirectMethod from a javascript function which is the handler for a "drop" in DragNDrop scenario between two grids. If I simply put an alert() in the javascript function notifyDrop (in place of the ext.net.directMethods code) everything works and the alert can show me what is being dropped where. With the DirectMethod call the drag and drop ceases to work and my directmethod is not executed.
JavaScript:
JavaScript:
var notifyDrop1 = function (ddSource, e, data) {
Ext.each(ddSource.dragData.selections, function (record) {
var mapto = data.selections[0].data.Description;
var rownum= <%= grdCurrentMap.ClientID %>.getView().findRowIndex(e.getTarget());
var mapfrom = <%= grdCurrentMap.ClientID %>.store.data.items[rownum].data.Description;
\\alert('test'); this works
Ext.net.DirectMethods.MapIt(mapfrom, mapto, {
success: function (result) {
Ext.Msg.alert('Message', result);
},
eventMask: {
showMask: true,
minDelay: 500
}
});
});
return true;
};
MarkUp: <ext:DropTarget ID="DropTarget1" runat="server" Target="={#{grdCurrentMap}.view.scroller.dom}" Group="GlobalAssetDD">
<NotifyDrop Fn="notifyDrop1" />
</ext:DropTarget>
Code Behind: <DirectMethod>
Public Sub MapIt(ByVal MapFrom As String, ByVal MapTo As String)
' do something here in code behind
End Sub
Last edited by Daniil; Mar 25, 2013 at 3:31 PM.
Reason: [CLOSED]