Dec 24, 2018, 3:56 AM
[CLOSED] Direct Method Not firing.
Hello again,
I have a commandColumn that generates message box with yes/no confirmation then fires directmethod in code behind if yes.
Code below was working in 1.7, now in v4 seems to have broken.
Given this a good couple of hours with no luck, the most I can get is the message box to fire but nothing on the yes button click.
Getting this error in the browser console if it helps. "Uncaught TypeError: Ext.Msg.Alert is not a function"
I have a commandColumn that generates message box with yes/no confirmation then fires directmethod in code behind if yes.
Code below was working in 1.7, now in v4 seems to have broken.
Given this a good couple of hours with no luck, the most I can get is the message box to fire but nothing on the yes button click.
Getting this error in the browser console if it helps. "Uncaught TypeError: Ext.Msg.Alert is not a function"
<script type="text/javascript">
var deleteOrder = function (grid, command, record, row) {
Ext.Msg.show({
title: 'Delete Order? This cannot be undone!',
msg: 'Deleting an order will delete all associated tickets, are you sure?',
buttons: Ext.Msg.YESNO,
icon: Ext.Msg.QUESTION,
fn: function (btn) {
if (btn == 'yes') {
Ext.net.DirectMethods.DeleteOrder(id);
}
}
});
}
</script>
<ext:GridPanel ID="GridPanelOrderTickets" runat="server" StripeRows="true" Title="Orders"
TrackMouseOver="true" Height="320" StoreID="SearchOrderStore" AutoScroll="true" Frame="true" Width="1400">
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:CommandColumn runat="server" Width="80" Header="Delete">
<Commands>
<ext:GridCommand Icon="Delete">
<ToolTip Text="Delete Order" />
</ext:GridCommand>
</Commands>
<Listeners>
<Command Fn="deleteOrder" />
</Listeners>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<DirectMethod()>
Public Sub DeleteOrder(ByVal OrderID As Integer)
Try
'Do stuff in here with OrderID
Catch ex As Exception
ShowInfoBox("Error", ex.Message, MessageBox.Icon.ERROR, False, "")
End Try
End Sub
Last edited by fabricio.murta; Mar 15, 2019 at 7:12 PM.
Reason: no feedback from the user in 7+ days