fraxzi Posted March 6, 2021 Share Posted March 6, 2021 Hi Everyone, My dbGrid has RowWidget (Master/Detail) ... a clientdataset has pending updates. I would like to limit the collapse of RowWidget unless user click the save button. Thanks in advance, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 6, 2021 Share Posted March 6, 2021 1 hour ago, fraxzi said: I would like to limit the collapse of RowWidget unless user click the save button. Hi, Can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 6, 2021 Author Share Posted March 6, 2021 Just now, Sherzod said: Hi, Can you please explain in more detail? Hi Sherzod, RowWidget has dbGrid (ClientDataSet) any update (by end-user) are not applied when RowWidget collapsed.. How to prevent the RowWidget from closing? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 6, 2021 Share Posted March 6, 2021 13 minutes ago, fraxzi said: RowWidget has dbGrid (ClientDataSet) any update (by end-user) are not applied when RowWidget collapsed.. How to prevent the RowWidget from closing? If possible, create a simple testcase, I will try to analyze it on your testcase. Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 6, 2021 Author Share Posted March 6, 2021 RowWidget.zip Hi @Sherzod, Here's my test case.. Open Widget.. modify dbgrid.. then close Widget... Thanks, Frances RowWidget.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 6, 2021 Share Posted March 6, 2021 OK, I will check. Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 13, 2021 Author Share Posted March 13, 2021 Hi @Sherzod Another thing, if there are two or more open RowWidget and I apply dbgrid.refresh the grid/app hang up.. If I apply dbgrid.RefreshCurrentRow, nothing is updated.. What am I missing? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 30, 2021 Author Share Posted March 30, 2021 @Sherzod, Any update? ... or at least how to close all open RowWidget so I can apply grid refresh? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
fraxzi Posted April 15, 2021 Author Share Posted April 15, 2021 On 3/30/2021 at 1:36 PM, fraxzi said: @Sherzod, Any update? ... or at least how to close all open RowWidget so I can apply grid refresh? Thanks, Frances Up ... Quote Link to comment Share on other sites More sharing options...
fraxzi Posted July 27, 2021 Author Share Posted July 27, 2021 Hi All / @Sherzod Any update? ... Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 27, 2021 Share Posted July 27, 2021 1 hour ago, fraxzi said: Any update? ... Hi, Sorry for the late response. I will try to analyze once again. Quote Link to comment Share on other sites More sharing options...
fraxzi Posted January 25 Author Share Posted January 25 HI @Sherzod I came across again with this project ... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 25 Share Posted January 25 1 hour ago, fraxzi said: I came across again with this project ... Hi, Yes, we need to resolve this issue. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 28 Share Posted January 28 Hello @fraxzi Let's start with some solutions. You can process it first on the client side to prevent it from collapsing if the grid is in the editing state. 1. procedure TDetailFrame.UniFrameDestroy(Sender: TObject); begin //Somewhere to prevent collapse of RowWidget if ClientDataSet has changes....??? //MessageDlg('There Are Changes... Save Data Entry?', mtConfirmation, mbYesNoCancel, uMsgCallBack); end; 2. MainForm.Script -> Ext.onReady(function() { Ext.override(Ext.grid.plugin.RowWidget, { toggleRow: function(rowIdx, record) { if (record && record.node) { var _nestedgrid = Ext.get(record.node).query('.x-grid')[0]; if (_nestedgrid) { var _editingPlugin = Ext.getCmp(_nestedgrid.id).editingPlugin; if (_editingPlugin && _editingPlugin.editing === true) { return false } } } this.callParent(arguments); } }) }) Quote Link to comment Share on other sites More sharing options...
fraxzi Posted January 29 Author Share Posted January 29 12 hours ago, Sherzod said: Hello @fraxzi Let's start with some solutions. You can process it first on the client side to prevent it from collapsing if the grid is in the editing state. 1. procedure TDetailFrame.UniFrameDestroy(Sender: TObject); begin //Somewhere to prevent collapse of RowWidget if ClientDataSet has changes....??? //MessageDlg('There Are Changes... Save Data Entry?', mtConfirmation, mbYesNoCancel, uMsgCallBack); end; 2. MainForm.Script -> Ext.onReady(function() { Ext.override(Ext.grid.plugin.RowWidget, { toggleRow: function(rowIdx, record) { if (record && record.node) { var _nestedgrid = Ext.get(record.node).query('.x-grid')[0]; if (_nestedgrid) { var _editingPlugin = Ext.getCmp(_nestedgrid.id).editingPlugin; if (_editingPlugin && _editingPlugin.editing === true) { return false } } } this.callParent(arguments); } }) }) Hi @Sherzod, I tried the above. The RowWidget still collapse then the messagedlg (with callbackl) prompts. Would it be possible to disable the collapse button and enable it when needed? Thanks for the usual assistance. -Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29 Share Posted January 29 53 minutes ago, fraxzi said: The RowWidget still collapse then the messagedlg (with callbackl) prompts. 12 hours ago, Sherzod said: procedure TDetailFrame.UniFrameDestroy(Sender: TObject); begin //Somewhere to prevent collapse of RowWidget if ClientDataSet has changes....??? //MessageDlg('There Are Changes... Save Data Entry?', mtConfirmation, mbYesNoCancel, uMsgCallBack); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29 Share Posted January 29 3 hours ago, fraxzi said: I tried the above. The RowWidget still collapse then the messagedlg (with callbackl) prompts. Because this is already another event. 2 hours ago, Sherzod said: UniFrameDestroy Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29 Share Posted January 29 3 hours ago, fraxzi said: Would it be possible to disable the collapse button and enable it when needed? Yes, You can keep a variable either on the client side or on the server side, and checking this variable in the toggleRow method... Quote Link to comment Share on other sites More sharing options...
fraxzi Posted January 30 Author Share Posted January 30 Hi @Sherzod, Thanks for the insight. However, I searched the forum with keyword "toggleRow" and all samples with .1580 but unfortunately there is no reference sample i could follow. - Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30 Share Posted January 30 2 hours ago, fraxzi said: toggleRow On 1/28/2024 at 6:26 PM, Sherzod said: MainForm.Script -> Ext.onReady(function() { Ext.override(Ext.grid.plugin.RowWidget, { toggleRow: function(rowIdx, record) { if (record && record.node) { var _nestedgrid = Ext.get(record.node).query('.x-grid')[0]; if (_nestedgrid) { var _editingPlugin = Ext.getCmp(_nestedgrid.id).editingPlugin; if (_editingPlugin && _editingPlugin.editing === true) { return false } } } this.callParent(arguments); } }) }) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30 Share Posted January 30 @fraxzi Tell me again what needs to be done? Controlling row collapsing based on a boolean variable? Quote Link to comment Share on other sites More sharing options...
fraxzi Posted January 31 Author Share Posted January 31 20 hours ago, Sherzod said: @fraxzi Tell me again what needs to be done? Controlling row collapsing based on a boolean variable? Hi @Sherzod, I tried the above but still I couldn't implement. Perhaps the easiest is to enable/disable the expand button? Thanks for your persistent help. -Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 31 Share Posted January 31 Hi, 8 minutes ago, fraxzi said: expand Do you mean collapse? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 31 Share Posted January 31 Ok @fraxzi try this approach: 1. MainForm.Script -> Ext.onReady(function() { Ext.override(Ext.grid.plugin.RowWidget, { toggleRow: function(rowIdx, record) { if (this.grid.expanderDisabled && this.grid.expanderDisabled === true) { return false } this.callParent(arguments); } }) }) 2. Usage: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBGrid1.JSInterface.JSAssign('expanderDisabled', [True]); // True, False end; 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.