I have a method like this one:
- Code: Select all
var
Button: TIWCGJQCustomButton;
LCancelOrderID : Integer;
LCancelOrderDesc : String;
LRowIndex : Integer;
begin
Button:= (Sender as TIWCGJQButtonOptions).Button;
LRowIndex := Button.Tag;
GridOrderItems.JQGridOptions.SetSelection(LRowIndex);
LCancelOrderID := StrToInt(GridOrderItems.JQGridProviderCells.CellValue[0, LRowIndex]);
LCancelOrderDesc := GridOrderItems.JQGridProviderCells.CellValue[3, LRowIndex];
IWCGMessageDlg(Format('Are you sure you want to cancel request %d for product "%s" ?',[LCancelOrderID,LCancelOrderDesc]),mtConfirmation,[mbYes,mbNo],
procedure(Dialog: TIWCGJQMsgDialog; AResult: TModalResult)
begin
if AResult = mrYes then
begin
//WebApplication.Lock;
try
OrderItems.CancelOrder(LCancelOrderID, UserSession.IMSession);
GridOrderItems.JQGridProviderCells.Rows.Delete(LRowIndex);
ReloadGrid(GridOrderItems);
finally
//WebApplication.Unlock;
end
end;
end);
end;
If i set a breakpoint at the last "End;" statement of the method it reaches that breakpoint before the dialog is shown.
is this normal behaviour of am i doing something wrong?
Eric