Jump to content

Recommended Posts

Posted

Hi.

 

I put the summary row as the first line of a grid.

 

My summary is for "qty" column, but only when a boolan column of the grid is checked, as the code below in the ColumnSummary procedure:

 

  if SameText(Column.FieldName, 'qty') then begin
    if Column.AuxValue=NULL then Column.AuxValue:=0.0;
    if qt.FieldByName('sel').asboolean then
       Column.AuxValue:=Column.AuxValue + qt.FieldByName('qty').asfloat;
  end;
 

 

As I can see, the summary calculation is wrong when the grid is paged. The summary only is calculated for the actual page of the grid.

 

Is there somethig I have forgotten?

 

Thanks.

Posted

And is there any way to show / hide the summary row in run-time?

 

For now can you try this?!:

 

1. UniDBGrid1 -> Summary -> Enabled = True ...

 

2. Show/Hide... :

UniDBGrid1.JSInterface.JSCall('getView().summaryFeature.summaryBar.show', []);
UniDBGrid1.JSInterface.JSCall('getView().summaryFeature.summaryBar.hide', []);
Posted

sorry, Not recognized JSInterface.

 

Build 1347:

 

[uNG-1933] - TUniControl: New JSInterface public property.

 

For your current build you can use like this:

UniSession.AddJS(UniDBGrid1.JSName + '.getView().summaryFeature.summaryBar.show();');
UniSession.AddJS(UniDBGrid1.JSName + '.getView().summaryFeature.summaryBar.hide();');
Posted

ok.

 

updated to last build, I get the AJAX error:

 

O8F9.getView(...).summaryFeature is undefined

 

Yes, for the first time you should set (in designtime):

UniDBGrid1 -> Summary -> Enabled = True ...

Can you check it?

Posted

I have a button to hide summary.

 

in the onclik event of the button I put the code:

 

grid1.JSInterface.JSCall('getView().summaryFeature.summaryBar.hide', []);
 

Posted

Ok, Then try this:

UniDBGrid1.JSInterface.JSCode('var me='#1'; var _view=me.normalGrid.getView() || me.getView(); if (_view) {_view.summaryFeature.summaryBar.show()};');
UniDBGrid1.JSInterface.JSCode('var me='#1'; var _view=me.normalGrid.getView() || me.getView(); if (_view) {_view.summaryFeature.summaryBar.hide()};');
Posted

Corrected:

 

Hide:

  UniDBGrid1.JSInterface.JSCode('var me='#1'; var _view=null; var _lockedview=null; if (!me.lockedGrid && !me.normalGrid) {_view=me.getView()} else {_view=me.normalGrid.getView(); _lockedview=me.lockedGrid.getView()}; '+
                                'if (_view) {_view.summaryFeature.summaryBar.hide()};'+
                                'if (_lockedview) {_lockedview.summaryFeature.summaryBar.hide()};'
  );

Show:

  UniDBGrid1.JSInterface.JSCode('var me='#1'; var _view=null; var _lockedview=null; if (!me.lockedGrid && !me.normalGrid) {_view=me.getView()} else {_view=me.normalGrid.getView(); _lockedview=me.lockedGrid.getView()}; '+
                                'if (_view) {_view.summaryFeature.summaryBar.show()};'+
                                'if (_lockedview) {_lockedview.summaryFeature.summaryBar.show()};'
  );
Posted

One question, I think not related with unigui. Sorry for this.

 

I've never used clientdataset, and in the samble on summary grid, I see thjat it's used.

 

Sometimes I need temporary tables, and I create them in my database, but I think clientdataset could be usefull for me, but I don't know how it works. It works with data in memory?

 

I copy / paste the clientdataset and datasource of the sample on a form of my project, but can't acivate the dataset. When open or set it to active, raises the error:

missing data provider or data packet.

 

Thanks.

  • 2 years later...
Posted

I did it, but got a error 

  if not UniDBGrid1.Summary.Enabled then
  begin
    UniDBGrid1.Summary.Enabled := True;
//    UniDBGrid1.OnColumnSummary := UniDBGrid1ColumnSummary;
//    UniDBGrid1.OnColumnSummaryResult := UniDBGrid1ColumnSummaryResult;
    UniDBGrid1.JSInterface.JSCode('var me='#1'; var _view=null; var _lockedview=null; if (!me.lockedGrid && !me.normalGrid) {_view=me.getView()} else {_view=me.normalGrid.getView(); _lockedview=me.lockedGrid.getView()}; '+
                                'if (_view) {_view.summaryFeature.summaryBar.show()};'+
                                'if (_lockedview) {_lockedview.summaryFeature.summaryBar.show()};'
    );

  end;

Cannot read property 'summaryBar' of undefined
 
Posted
4 hours ago, sertatar76 said:

I did it, but got a error 

 

On 12/29/2016 at 4:04 PM, Sherzod said:

Yes, for the first time you should set (in designtime):


UniDBGrid1 -> Summary -> Enabled = True ...

Can you check it?

 

  • 5 years later...
Posted
On 12/28/2016 at 2:17 PM, Sherzod said:

 

For now can you try this?!:

 

1. UniDBGrid1 -> Summary -> Enabled = True ...

 

2. Show/Hide... :

UniDBGrid1.JSInterface.JSCall('getView().summaryFeature.summaryBar.show', []);
UniDBGrid1.JSInterface.JSCall('getView().summaryFeature.summaryBar.hide', []);

Hi Sherzod,

is there also a solution to show and hide grid summaryRow at RunTime für mobile TUnimDBGrid?

Thx in advance

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...