PetrB Posted December 17, 2017 Share Posted December 17, 2017 Hi all, I start play with this powerfull enviroment to Before-buy try. I try customize TUniDBGrid a bit for my needs. I did found some piece of code to add button in line with refresh and paginal buttons on DBGrid footer. I use this code in TabulkaKaret:TUniDBGrid.ClickEvents.UniEvents.Ext.toolbar.Paging[pagingBar].afterCreate function pagingBar.afterCreate(sender) { sender.add([ { xtype: 'button', icon: 'files/images/navigate_plus.png', tooltip: 'Přidej řádek', handler: function() { ajaxRequest( MainForm.DetailUctuFrame,'addRow', ["slctd="+MainForm.DetailUctuFrame.TabulkaKaret.getSelectionModel().getCount()] ); } }, { xtype: 'button', icon: 'files/images/navigate_edit.png', tooltip: 'Oprav řádek', handler: function() { ajaxRequest( DetailUctuFrame.window,'edRow', ["slctd="+TabulkaKaret.getSelectionModel().getCount()] ); } }, { xtype: 'button', icon: 'files/images/navigate_minus.png', tooltip: 'Zruš aktuální řádek', handler: function() { ajaxRequest(MainForm.window, 'delRow', ["slctd="+DetailUctuFrame.TabulkaKaret.getSelectionModel().getCount()]); } } ]); The creating is working fine, I have 3 new buttons on position where I exactly want to have it. The problem is, that I'm not to able catch click on those buttons. I have main form called MainForm:TMainForm.. The TabulkaKaret.TUniDBGrid is situated on DetailUctuFrame:TDetailUctuFrame. My ajaxRequests are bad, but I don't know, how to write a correct syntax. Could you help me, please. Best regards Petr Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 17, 2017 Share Posted December 17, 2017 Hi, Can you make a simple testcase for this ? Best regards, Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 17, 2017 Author Share Posted December 17, 2017 Hi, what do you mean? If I use this code above, my three buttons are created. I have on my frame code for AjaxEvent catch procedure TDetailUctuFrame.UniFrameAjaxEvent(Sender : TComponent;eventname: String;Params : TUniStrings); Begin //here is a breakpoint inherited; End; the breakpoint catch situation, : Sender=TabulkaKaret (the DBGrid) EventName=data Sender=TabulkaKaret EventName=load Sender=TabulkaKaret EventName=load Sender=TabulkaKaret EventName=load Sender=TabulkaKaret EventName=load I have three records in my table. But when I press one of new buttons, there is no action in this routine. I need to put some code "somewhere" to make service with those buttons. PetrB Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 I did use code from this articel, but the catch of click is not working for me. Could you give me some advice how to construct Ajax calling to catch it in Frame inside of MainWindow? Thank you PetrB Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 21, 2017 Share Posted December 21, 2017 Hi, Which edition and build are you using? Best regards, Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 I did download last (this weekend) demo version from server. Where should I find the version? Pb Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 This text is in start of my application HTML code <link rel=stylesheet href="/uni-1.0.0.1421/css/uni-ext.css" /><link rel=stylesheet href="/ext-4.2.5.1763/resources/css/ext-all.css" /><script src="/ext-4.2.5.1763/ext-all.js"></script><script src="/uni-1.0.0.1421/ext-unicommon-min.js"></script><script src="/uni-1.0.0.1421/ext-sync-min.js"></script><script src="/ext-4.2.5.1763/locale/ext-lang-cs.js"></script><script type="text/javascript"> Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 21, 2017 Share Posted December 21, 2017 If possible, can you make a testcase for this ? Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 What do you mean test case? I could send you my code but it's connected to my Oracle DB. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 21, 2017 Share Posted December 21, 2017 Sorry, I think that you can make a testcase without DB Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 21, 2017 Share Posted December 21, 2017 Maybe I do not fully understand your issue,Can you explain once again what is your problem, and how can we reproduce it? Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 The code used for buttons creating is in first post of this articel. Buttons are created but I can't catch the pressing of it. Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 In TDetailUctuFrame (there is situated Grid and frame is hosted by TMainForm) procedure TDetailUctuFrame.UniFrameAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);begin //Breakpoint here, to catch Event inherited;//end; Quote Link to comment Share on other sites More sharing options...
PetrB Posted December 21, 2017 Author Share Posted December 21, 2017 In code for creating buttons I did make a couple of attempts to find correct syntax but without success. Pb Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.