Freeman35 Posted January 24, 2018 Share Posted January 24, 2018 Hello, How can I do, handle dbnavigator butoon click then discard default action then get ajaxRequest(me, '_xxxx', [])Thank you Link to comment Share on other sites More sharing options...
Sherzod Posted January 24, 2018 Share Posted January 24, 2018 Hello, Sorry, what you wanted ?!... Link to comment Share on other sites More sharing options...
Freeman35 Posted January 24, 2018 Author Share Posted January 24, 2018 This code not working. I mean "Abort;" not stop inserting. procedure TFRM_.NAV_1BeforeAction(Sender: TObject; Button: TNavigateBtn); begin if button=nbInsert then Abort; end; Why I need: When endUser Clieck to insert I haveto handle it, then I wanna open my form. At this point, My dataset not will be insert mode. 'cos, this create transaction on server, and client need access to server, just if need post value to dataset. dbnavigator, directly set insert mode sdEdit as well. Maybe can say, dbNavigator work like a nondb Its get db status so set buttons enable disable, but not sent command to dataset. I hope traslate Link to comment Share on other sites More sharing options...
Sherzod Posted January 24, 2018 Share Posted January 24, 2018 Hi, This code not working. I mean "Abort;" not stop inserting. procedure TFRM_.NAV_1BeforeAction(Sender: TObject; Button: TNavigateBtn); begin if button=nbInsert then Abort; end; Sorry, I couldn't reproduce this issue, works for me uses ... DBCtrls; procedure TMainForm.UniDBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn); begin if button=nbInsert then Abort; end; Link to comment Share on other sites More sharing options...
Freeman35 Posted January 24, 2018 Author Share Posted January 24, 2018 you mean, procedure TMainForm.UniDBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn); begin if Button = nbfirst then Abort; ShowMessage('not aborted !!!!'); end; not work "ShowMessage" and unidbgrid not add new empty line aren't you? becouse I saw thats on my project, so I cancel use dbnavigator, add buttons to form and made manual navigator. If its posible test this messagebox added code and write result. Thank you for your help. Link to comment Share on other sites More sharing options...
Sherzod Posted January 24, 2018 Share Posted January 24, 2018 Sorry, seems it is not clear to me what you want, Also, maybe you need this approach ?!: 1. UniDBGrid -> ClientEvents -> ExtEvents -> function afterrender: function afterrender(sender, eOpts) { var me = sender; if (me.pagingBar) { me.pagingBar.getComponent("first").handler = function() { ajaxRequest(me, '_nbfirst', []) } } } 2. UniDBGrid -> OnAjaxEvent: procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_nbfirst' then begin // your custom logic ShowMessage('first'); end; end; Link to comment Share on other sites More sharing options...
Freeman35 Posted January 25, 2018 Author Share Posted January 25, 2018 Thank you for your help. I clean everythink, and reinstall, now work normally. Thank you, regards procedure TMainForm.UniDBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn); begin if not My_var__Is_Admin and Button in [nbInsert, nbEdit, nbDelete] then begin ShowMessage('You can not modify !!!!'); Abort; ShowMessage('If you see this message, huston we have a BIG problem...not aborted !!!!'); end; end; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now