jQWidgets Forums
jQuery UI Widgets › Forums › Grid › URGENT: Showing Aggregates in grid footer
This topic contains 4 replies, has 3 voices, and was last updated by mohit546 5 years, 4 months ago.
-
Author
-
Dear Community,
We have a requirement to aggregate the total of a grid column and show its value in the grid footer. I was wondering if this is possible?
We have three columns in the grid called ID, Name and Salary. We want to show total of Salary column at the bottom of the grid. Can some one please help me how to do this?
Regards,
ShivaHi Shiva,
The requested functionality is still not implemented in jqxGrid. As a solution, you can manually iterate through the dataAdapter’s ‘records'(this is an array which contains the loaded data from your data source) and calculate the summary of your ‘Salary’ column and display the result in a DIV tag below the Grid.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI’ll try that way out.
Is there any possibility that we can create a grid without specifying its columns? I mean, in case of a dynamic grid where number of columns isnt known at the beginning. How to achieve that?
Hi shivaw,
You must have at least one column to display in the Grid when you initialize it. There’s no table without columns.
To dynamically change the columns you need to set the columns property to your columns array.
For example:
var columns = [ { text: 'First Name', dataField: 'firstname', width: 100 }, { text: 'Last Name', dataField: 'lastname', width: 100 }, { text: 'Product', dataField: 'productname', width: 180 }, { text: 'Quantity', dataField: 'quantity', width: 80, cellsalign: 'right' }, { text: 'Unit Price', dataField: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' }, { text: 'Total', dataField: 'total', cellsalign: 'right', minwidth: 100, cellsformat: 'c2' } ]; // create a Grid with one column $("#jqxgrid").jqxGrid( { source: dataAdapter, columns: [ { text: 'First Name', dataField: 'firstname', width: 100 } ] }); // change columns collection. $("#jqxgrid").jqxGrid({ columns: columns });
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comhi,
Is their any update on this requirement. I wanted to implement same thing, like all columns total should be on last row. I already have total calculated from api side i just need to append that additional row to bottom of the table and it should be always on bottom after pager changes. anything would be helpful, thank you.Regards,
Mohit -
AuthorPosts
You must be logged in to reply to this topic.