Lena Posted June 30, 2015 Share Posted June 30, 2015 Hi.I have two questions on the update button.1. What event in the Object Inspector occurs when I press this button?2. How to make this button invisible?Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 30, 2015 Share Posted June 30, 2015 Hi, 1. It may help: http://forums.unigui.com/index.php?/topic/4425-grid-refresh-button/&do=findComment&comment=21879 2. Try: UniDBGrid1 -> .... function afterrender(sender, eOpts) { if (sender.pagingBar) { sender.pagingBar.getComponent("refresh").hide() } } Best regards! Quote Link to comment Share on other sites More sharing options...
Lena Posted June 30, 2015 Author Share Posted June 30, 2015 2. Try: UniDBGrid1 -> .... Thank you very much! 1. It may help: Sorry but I do not understand how can be updated uniDBGrid from javascript code. function afterrender(sender, eOpts) { sender.pagingBar.getComponent("refresh").handler = function () { //your custom logic... //UniMainModule().ClientDataSet1.Refresh(); ??? alert("test"); } } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 30, 2015 Share Posted June 30, 2015 Try: function afterrender(sender, eOpts) { sender.pagingBar.getComponent("refresh").handler = function () { //your custom logic... sender.getStore().load(); } } Quote Link to comment Share on other sites More sharing options...
Lena Posted June 30, 2015 Author Share Posted June 30, 2015 Unfortunately it is not running. I think the best option to hide this refresh button. function afterrender(sender, eOpts) { if (sender.pagingBar) { sender.pagingBar.getComponent("refresh").hide() } } And then make a separate button on the form with code refresh ClientDataSet. Quote Link to comment Share on other sites More sharing options...
aln02 Posted July 1, 2015 Share Posted July 1, 2015 Hi. Try: 1.UniDBGrid1 -> ....function afterrender(sender, eOpts){ sender.pagingBar.getComponent("refresh").handler = function () { ajaxRequest(MainForm.window, 'Grid1Refresh', []); }} 2.MainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);begin if EventName='Grid1Refresh' then UniMainModule.ClientDataSet1.Refresh;end; Quote Link to comment Share on other sites More sharing options...
Lena Posted July 2, 2015 Author Share Posted July 2, 2015 Thank you very much! I will try your code in C++ Builder XE7. 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.