Bob Weiner Jr | 3 Sep 16:53 2013
Picon

Displaying Totals in ng-grid

Is there a way to display a traditional footer row with column totals with ng-grid?

I need to display an itemized billing statement for a job which will have columns such as Item, UnitCost, Quantity, and ItemCost.  The footer row should contain the total cost which is the sum of all the ItemCosts.  I am not interested in the footer panel which shows totalServerItems nor am I using grouping that allows for aggregate rows.  

I suppose one solution would be to calculate my own footer row using nulls in the columns that have no totals and then add it to the dataset.  It seems that since ng-grid provides a method to define aggregates for groups, that it would do something similar to the whole enchilada.



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Bob Weiner Jr | 4 Sep 14:49 2013
Picon

Re: Displaying Totals in ng-grid

Someone throw me a bone here.

Is this a silly thing to do with a data table?  It is done all the time with Excel.

Has this already been discussed in this group or elsewhere?  I have searched and can find no examples.

Just a link would be great!
Thanks


On Tuesday, September 3, 2013 10:53:57 AM UTC-4, Bob Weiner Jr wrote:
Is there a way to display a traditional footer row with column totals with ng-grid?

I need to display an itemized billing statement for a job which will have columns such as Item, UnitCost, Quantity, and ItemCost.  The footer row should contain the total cost which is the sum of all the ItemCosts.  I am not interested in the footer panel which shows totalServerItems nor am I using grouping that allows for aggregate rows.  

I suppose one solution would be to calculate my own footer row using nulls in the columns that have no totals and then add it to the dataset.  It seems that since ng-grid provides a method to define aggregates for groups, that it would do something similar to the whole enchilada.



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
W White | 4 Sep 17:58 2013
Picon

Re: Displaying Totals in ng-grid

I wound up making a local fork of ng-grid to support the needs of my app (double-click handler for rows, click-to-expand icon for tree grids or detail grids with server-side retrieval, and using control key for multi-select, in case you're curious).  I recommend that.

Or, if you're trying to make something that looks like Excel, you might be happier with a framework which offers comprehensiveness and consistency at the expense of less flexibility, greater overhead, non-FOSS license, and other trade-offs (e.g., ExtJS pretty much abstracts away HTML and the DOM entirely, which you may love or may hate).


On Wednesday, September 4, 2013 8:49:43 AM UTC-4, Bob Weiner Jr wrote:
Someone throw me a bone here.

Is this a silly thing to do with a data table?  It is done all the time with Excel.

Has this already been discussed in this group or elsewhere?  I have searched and can find no examples.

Just a link would be great!
Thanks


On Tuesday, September 3, 2013 10:53:57 AM UTC-4, Bob Weiner Jr wrote:
Is there a way to display a traditional footer row with column totals with ng-grid?

I need to display an itemized billing statement for a job which will have columns such as Item, UnitCost, Quantity, and ItemCost.  The footer row should contain the total cost which is the sum of all the ItemCosts.  I am not interested in the footer panel which shows totalServerItems nor am I using grouping that allows for aggregate rows.  

I suppose one solution would be to calculate my own footer row using nulls in the columns that have no totals and then add it to the dataset.  It seems that since ng-grid provides a method to define aggregates for groups, that it would do something similar to the whole enchilada.



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Bob Weiner Jr | 5 Sep 03:23 2013
Picon

Re: Displaying Totals in ng-grid

I don't need full Excel functionality, just some totals. I was hoping that this would be a common need and that there was something that I was missing.

Do you think it is easier (i.e. faster) to fork ng-grid or just create a javascript object using underscore.js and display it in a bootstrap table?  Some items will need editing but that can be done with a form (another directive).




On Wednesday, September 4, 2013 11:58:19 AM UTC-4, W White wrote:
I wound up making a local fork of ng-grid to support the needs of my app (double-click handler for rows, click-to-expand icon for tree grids or detail grids with server-side retrieval, and using control key for multi-select, in case you're curious).  I recommend that.

Or, if you're trying to make something that looks like Excel, you might be happier with a framework which offers comprehensiveness and consistency at the expense of less flexibility, greater overhead, non-FOSS license, and other trade-offs (e.g., ExtJS pretty much abstracts away HTML and the DOM entirely, which you may love or may hate).


On Wednesday, September 4, 2013 8:49:43 AM UTC-4, Bob Weiner Jr wrote:
Someone throw me a bone here.

Is this a silly thing to do with a data table?  It is done all the time with Excel.

Has this already been discussed in this group or elsewhere?  I have searched and can find no examples.

Just a link would be great!
Thanks


On Tuesday, September 3, 2013 10:53:57 AM UTC-4, Bob Weiner Jr wrote:
Is there a way to display a traditional footer row with column totals with ng-grid?

I need to display an itemized billing statement for a job which will have columns such as Item, UnitCost, Quantity, and ItemCost.  The footer row should contain the total cost which is the sum of all the ItemCosts.  I am not interested in the footer panel which shows totalServerItems nor am I using grouping that allows for aggregate rows.  

I suppose one solution would be to calculate my own footer row using nulls in the columns that have no totals and then add it to the dataset.  It seems that since ng-grid provides a method to define aggregates for groups, that it would do something similar to the whole enchilada.



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
George Karkalis | 30 Sep 11:05 2013
Picon

Re: Displaying Totals in ng-grid

Have you found any solution on this? We also have the same need...

On Thursday, 5 September 2013 04:23:32 UTC+3, Bob Weiner Jr wrote:
I don't need full Excel functionality, just some totals. I was hoping that this would be a common need and that there was something that I was missing.

Do you think it is easier (i.e. faster) to fork ng-grid or just create a javascript object using underscore.js and display it in a bootstrap table?  Some items will need editing but that can be done with a form (another directive).




On Wednesday, September 4, 2013 11:58:19 AM UTC-4, W White wrote:
I wound up making a local fork of ng-grid to support the needs of my app (double-click handler for rows, click-to-expand icon for tree grids or detail grids with server-side retrieval, and using control key for multi-select, in case you're curious).  I recommend that.

Or, if you're trying to make something that looks like Excel, you might be happier with a framework which offers comprehensiveness and consistency at the expense of less flexibility, greater overhead, non-FOSS license, and other trade-offs (e.g., ExtJS pretty much abstracts away HTML and the DOM entirely, which you may love or may hate).


On Wednesday, September 4, 2013 8:49:43 AM UTC-4, Bob Weiner Jr wrote:
Someone throw me a bone here.

Is this a silly thing to do with a data table?  It is done all the time with Excel.

Has this already been discussed in this group or elsewhere?  I have searched and can find no examples.

Just a link would be great!
Thanks


On Tuesday, September 3, 2013 10:53:57 AM UTC-4, Bob Weiner Jr wrote:
Is there a way to display a traditional footer row with column totals with ng-grid?

I need to display an itemized billing statement for a job which will have columns such as Item, UnitCost, Quantity, and ItemCost.  The footer row should contain the total cost which is the sum of all the ItemCosts.  I am not interested in the footer panel which shows totalServerItems nor am I using grouping that allows for aggregate rows.  

I suppose one solution would be to calculate my own footer row using nulls in the columns that have no totals and then add it to the dataset.  It seems that since ng-grid provides a method to define aggregates for groups, that it would do something similar to the whole enchilada.



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
blind boy | 2 Oct 22:07 2013
Picon

Re: Displaying Totals in ng-grid

not into footer, but header
1. expanded header ( gridOption: headerRowHeight: 60) 
2. then for columns that needs to sum values changed custom header template 
<div class="ngCellNumber">{{total(col.field).toLocaleString("et-EE",{"style": "currency", "currency": "EUR", minimumFractionDigits: 2})}}</div>
3. then in controller added this function
$scope.total = function(col){
x = 0;
return $scope.myData.reduce(function(a, b){x += b[col]; return x;}, $scope.myData[0]);
};
where myData is data



On Monday, September 30, 2013 12:05:27 PM UTC+3, George Karkalis wrote:
Have you found any solution on this? We also have the same need...

On Thursday, 5 September 2013 04:23:32 UTC+3, Bob Weiner Jr wrote:
I don't need full Excel functionality, just some totals. I was hoping that this would be a common need and that there was something that I was missing.

Do you think it is easier (i.e. faster) to fork ng-grid or just create a javascript object using underscore.js and display it in a bootstrap table?  Some items will need editing but that can be done with a form (another directive).




On Wednesday, September 4, 2013 11:58:19 AM UTC-4, W White wrote:
I wound up making a local fork of ng-grid to support the needs of my app (double-click handler for rows, click-to-expand icon for tree grids or detail grids with server-side retrieval, and using control key for multi-select, in case you're curious).  I recommend that.

Or, if you're trying to make something that looks like Excel, you might be happier with a framework which offers comprehensiveness and consistency at the expense of less flexibility, greater overhead, non-FOSS license, and other trade-offs (e.g., ExtJS pretty much abstracts away HTML and the DOM entirely, which you may love or may hate).


On Wednesday, September 4, 2013 8:49:43 AM UTC-4, Bob Weiner Jr wrote:
Someone throw me a bone here.

Is this a silly thing to do with a data table?  It is done all the time with Excel.

Has this already been discussed in this group or elsewhere?  I have searched and can find no examples.

Just a link would be great!
Thanks


On Tuesday, September 3, 2013 10:53:57 AM UTC-4, Bob Weiner Jr wrote:
Is there a way to display a traditional footer row with column totals with ng-grid?

I need to display an itemized billing statement for a job which will have columns such as Item, UnitCost, Quantity, and ItemCost.  The footer row should contain the total cost which is the sum of all the ItemCosts.  I am not interested in the footer panel which shows totalServerItems nor am I using grouping that allows for aggregate rows.  

I suppose one solution would be to calculate my own footer row using nulls in the columns that have no totals and then add it to the dataset.  It seems that since ng-grid provides a method to define aggregates for groups, that it would do something similar to the whole enchilada.



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Gmane