Forum > Beginners
TDBNavigator - Taborder
wp:
You do not call the inherited method. And I'd invert the logic because I am not sure which ModalResult is returned when the dialog is closed by the 'x' button in the title bar (is it mrCancel? or is it mrClose?):
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TformMain.DataSetDelete1Execute(Sender: TObject);begin if MessageDlg('Eintrag löschen?',mtConfirmation,[mrCancel,mbOK],0) = mrOK then inherited else Abort;end;
Another possibility would be to use a standard action in place of the DatabaseAction and code the deletion manually:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---TFormMain.DeleteActionExecute(Sender: TObject); // TDeleteAction is a standard action with manually set Caption='Delete', Hint='Delete record' and with this OnExecute handler.begin if MessageDlg('Eintrag löschen?', mtConfirmation, [mbOK, mbCancel], 0) = mrOK then MyDataset.Delete;end; // Disables the button when deletion is not possible.procedure TMainForm.DeleteAction(Sender: TObject);begin DeleteAction.Enabled := MyDataset.Active and MyDataset.CanModify and not (MyDataset.BOF and MyDataset.EOF);end;
Navigation
[0] Message Index
[*] Previous page