molla2005b Posted February 28, 2017 Share Posted February 28, 2017 hi I m useing UniDbGrid and want to span a rows base on a Column DataIs this practical? thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 1, 2017 Share Posted March 1, 2017 Hi, Can you try to use this approach?, but of course with some "limitations" I think... For example for "column=0": 1. UniDBGrid -> ClienEvent -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.updateRowSpan = function() { var columns = sender.getColumns(), view = sender.getView(), store = sender.getStore(), rowCount = store.getCount(), column = columns[0], dataIndex = column.dataIndex, spanCell = null, spanCount = null; spanValue = null; for (var row = 0; row < rowCount; ++row) { var cell = view.getCellByPosition({ row: row, column: 0 }).dom, record = store.getAt(row), value = record.get(dataIndex); if (spanValue != value) { if (spanCell !== null) { spanCell.rowSpan = spanCount; } Ext.fly(cell).setStyle('display', ''); spanCell = cell; spanCount = 1; spanValue = value; } else { spanCount++; Ext.fly(cell).setStyle('display', 'none'); } } if (spanCell !== null) { spanCell.rowSpan = spanCount; } }; } 2. UniDBGrid -> ClienEvent -> UniEvents -> function afterCreate: function afterCreate(sender) { sender.getView().on('refresh', sender.updateRowSpan, sender); } Result: http://jsfiddle.net/wQSQM/3/ Best regards. Quote Link to comment Share on other sites More sharing options...
molla2005b Posted March 1, 2017 Author Share Posted March 1, 2017 wow!!!Thanks dear Thanks for your fast answer Quote Link to comment Share on other sites More sharing options...
powergov Posted March 13, 2017 Share Posted March 13, 2017 Hi,Delphi Developer if change dataset,for example:append record or delete record ,the unidbgrid is wrong! There are more perfect way? thank you Quote Link to comment Share on other sites More sharing options...
powergov Posted March 13, 2017 Share Posted March 13, 2017 Hi, Can you try to use this approach?, but of course with some "limitations" I think... For example for "column=0": 1. UniDBGrid -> ClienEvent -> UniEvents -> function beforeInit: function beforeInit(sender, config) { config.updateRowSpan = function() { var columns = sender.getColumns(), view = sender.getView(), store = sender.getStore(), rowCount = store.getCount(), column = columns[0], dataIndex = column.dataIndex, spanCell = null, spanCount = null; spanValue = null; for (var row = 0; row < rowCount; ++row) { var cell = view.getCellByPosition({ row: row, column: 0 }).dom, record = store.getAt(row), value = record.get(dataIndex); if (spanValue != value) { if (spanCell !== null) { spanCell.rowSpan = spanCount; } Ext.fly(cell).setStyle('display', ''); spanCell = cell; spanCount = 1; spanValue = value; } else { spanCount++; Ext.fly(cell).setStyle('display', 'none'); } } if (spanCell !== null) { spanCell.rowSpan = spanCount; } }; } 2. UniDBGrid -> ClienEvent -> UniEvents -> function afterCreate: function afterCreate(sender) { sender.getView().on('refresh', sender.updateRowSpan, sender); } Result: CellsMerge.png http://jsfiddle.net/wQSQM/3/ Best regards. Hi,Delphi Developer if change dataset,for example:append record or delete record ,the unidbgrid is wrong! There are more perfect way? thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 13, 2017 Share Posted March 13, 2017 Hi, if change dataset,for example:append record or delete record ,the unidbgrid is wrong! How do you do it?! Can you try to use this code after modification?: UniSession.AddJS(UniDBGrid1.JSName + '.view.refresh();'); Quote Link to comment Share on other sites More sharing options...
powergov Posted March 14, 2017 Share Posted March 14, 2017 Hi, How do you do it?! Can you try to use this code after modification?: UniSession.AddJS(UniDBGrid1.JSName + '.view.refresh();'); Hi, I try it,but unidbgrid not refresh,must repaint ?? md01.FDQ_jiageZB.edit; md01.FDQ_jiageZB.FieldByName('grp_par_parname').AsString := trim(UniComboBox1.Text); md01.FDQ_jiageZB.FieldByName('grp_parname').AsString := trim(UniComboBox2.Text) ; md01.FDQ_jiageZB.FieldByName('grp_name').AsString := trim(Uniedit1.Text); md01.FDQ_jiageZB.FieldByName('grp_price01').AsFloat := strtofloat(Uniedit2.Text) ; md01.FDQ_jiageZB.FieldByName('grp_price02').AsFloat := strtofloat(Uniedit3.Text) ; md01.FDQ_jiageZB.FieldByName('grp_price03').AsFloat := strtofloat(Uniedit4.Text) ; md01.FDQ_jiageZB.post ; //UniSession.AddJS(UniDBGrid2.JSName + '.view.beforeInit();'); //UniSession.AddJS(UniDBGrid2.JSName + '.view.repaint();'); UniSession.AddJS(UniDBGrid2.JSName + '.view.refresh();'); Quote Link to comment Share on other sites More sharing options...
powergov Posted March 14, 2017 Share Posted March 14, 2017 Hi, How do you do it?! Can you try to use this code after modification?: UniSession.AddJS(UniDBGrid1.JSName + '.view.refresh();'); Hi,Delphi Developer,where are you ? I need you help Quote Link to comment Share on other sites More sharing options...
molla2005b Posted March 14, 2017 Author Share Posted March 14, 2017 use pascal code mybe work UniDBGrid1.refresh; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 14, 2017 Share Posted March 14, 2017 use pascal code mybe work UniDBGrid1.refresh; Yes, powergov you can try this. Quote Link to comment Share on other sites More sharing options...
powergov Posted March 15, 2017 Share Posted March 15, 2017 thank you very much Quote Link to comment Share on other sites More sharing options...
gerardocrisci Posted June 26, 2018 Share Posted June 26, 2018 All of this does not work in extjs 6. Does anyone have a solution? Thank you Quote Link to comment Share on other sites More sharing options...
unicasoft Posted March 7, 2021 Share Posted March 7, 2021 We need to cell merging in dbgrid new versions. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 7, 2021 Share Posted March 7, 2021 Just now, unicasoft said: We need to cell merging in dbgrid new versions. Hello, Please specify which edition of UniGUI are you using? Quote Link to comment Share on other sites More sharing options...
JamesP Posted September 23, 2021 Share Posted September 23, 2021 On 3/7/2021 at 9:19 PM, Sherzod said: Hello, Please specify which edition of UniGUI are you using? Hello, It doesn't work at the latest complete Professional edition 1.90.0.1551 Could you please suggest any solutions to Merge Cells in column for the same value? Kind Regards, J Quote Link to comment Share on other sites More sharing options...
loQsoft Posted March 20, 2022 Share Posted March 20, 2022 On 3/8/2021 at 12:19 AM, Sherzod said: Hello, Please specify which edition of UniGUI are you using? Hello @Sherzod, There is a way to Merge Cells for the same value ? Version : 1.90.0.1551 Best Regard, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 21, 2022 Share Posted March 21, 2022 Hello @loQsoft I don't know, this solution was for the old version. Need to investigate. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 22, 2022 Share Posted March 22, 2022 On 9/24/2021 at 12:12 AM, JamesP said: It doesn't work at the latest complete Professional edition 1.90.0.1551 Could you please suggest any solutions to Merge Cells in column for the same value? On 3/21/2022 at 3:32 AM, loQsoft said: There is a way to Merge Cells for the same value ? Version : 1.90.0.1551 Hello, You can try with these changes: function beforeInit(sender, config) { config.updateRowSpan = function() { var columns = sender.getColumns(), view = sender.getView(), store = sender.getStore(), rowCount = store.getCount(), colIndx = 1; // second column for example column = columns[colIndx], dataIndex = column.dataIndex, spanCell = null, spanCount = null; spanValue = null; for (var row = 0; row < rowCount; ++row) { var cell = view.getCellByPosition({ row: row, column: colIndx }).dom, record = store.getAt(row), value = record.get(dataIndex); if (spanValue != value) { if (spanCell !== null) { spanCell.rowSpan = spanCount; } //Ext.fly(cell).setStyle('display', ''); Ext.fly(cell).query('.x-grid-cell-inner')[0].style.display=''; spanCell = cell; spanCount = 1; spanValue = value; } else { spanCount++; //Ext.fly(cell).setStyle('display', 'none'); Ext.fly(cell).query('.x-grid-cell-inner')[0].style.display='none'; } } if (spanCell !== null) { spanCell.rowSpan = spanCount; } }; } function afterCreate(sender) { sender.getView().on('refresh', sender.updateRowSpan, sender); } 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 22, 2022 Share Posted March 22, 2022 1 Quote Link to comment Share on other sites More sharing options...
loQsoft Posted April 8, 2022 Share Posted April 8, 2022 Hello @Sherzod Thank you for your contacts regarding uniGui. Your suggestions are 99% successful in my targetGUi, a plan for answering projects. I use it. Delphi 10.2 uniGui 1.90.0.1550 However, this does not work for your suggestion. Could it be from the UniGUI version? Best regards, 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 8, 2022 Share Posted April 8, 2022 2 hours ago, loQsoft said: Could it be from the UniGUI version? Hello, Can you check the above solution by creating a simple app? 1 Quote Link to comment Share on other sites More sharing options...
loQsoft Posted April 8, 2022 Share Posted April 8, 2022 @Sherzod Hello and Thank you very much, it is my fault. and i wonder how i can merge colum 1, colum 3 and colum 4 in a same dbgrid ? it is possible Best regards, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 9, 2022 Share Posted April 9, 2022 19 minutes ago, loQsoft said: and Thank you very much, it is my fault. Okay, np. 19 minutes ago, loQsoft said: and i wonder how i can merge colum 1, colum 3 and colum 4 in a same dbgrid ? Do you mean individually or exactly horizontally? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 9, 2022 Share Posted April 9, 2022 4 hours ago, loQsoft said: Thank you for your contacts regarding uniGui. Your suggestions are 99% successful in my targetGUi, a plan for answering projects. Thank you Quote Link to comment Share on other sites More sharing options...
loQsoft Posted April 9, 2022 Share Posted April 9, 2022 config.updateRowSpan = function() { var columns = sender.getColumns(), view = sender.getView(), store = sender.getStore(), rowCount = store.getCount(), colIndx = 1; // second column for example--> IT IS SECOND COLUMN column = columns[colIndx], dataIndex = column.dataIndex, if there are 3 coulmn to merge ? what can i do ? I mean ColIndx = 1; for one column and column number second i try to learn; vertically Best Regards, 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.