jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Total at the Node Level
This topic contains 6 replies, has 2 voices, and was last updated by Todor 6 years ago.
-
AuthorTotal at the Node Level Posts
-
Hi,
I have created a Grid. For which I have created dynamic columns for each Month in Year. this hierarchical grid has 2 Parent Nodes. And Looks like below. I can see the Grand Total. But I would like to have Total at each Node Level.
https://ibb.co/0CHc8B6
As per above image i would like to have total under Labor and Non-Labor node level dynamically for each Column
Below is my code for Grid population
$(curGridId).jqxGrid( { width: '99%', height: '99%', source: dataAdapter, groupable: true, //groupsrenderer: groupsrenderer, groups: ['Parent', 'Category'], showgroupsheader: false, editable: true, theme: 'energyblue', selectionmode: 'singlecell', showgroupaggregates: false, showstatusbar: true, showaggregates: true, statusbarheight: 25, columns: allColumnsArray, autowidth: false, editmode: 'click', localization:{ currencysymbol: projectCurrency}, ready: function () { $(curGridId).jqxGrid('hidecolumn', 'Parent'); $(curGridId).jqxGrid('hidecolumn', 'Category'); $(curGridId).jqxGrid('hidecolumn', 'img'); } //columnsresize: true /*columngroups: [ { text: 'June-2016', align: 'center', name: 'June-2016' }, { text: 'July-2016', align: 'center', name: 'July-2016' } ]*/ });
Dynamic Column Code
for (var iMonth = 0; iMonth < month.length; iMonth++) { var monthColumns = {} monthColumns['text'] = month[iMonth]; monthColumns['datafield'] = month[iMonth] + iMonth.toString(); monthColumns['map'] = iMonth.toString(); monthColumns['width'] = 125; monthColumns['cellsalign'] = 'Right'; monthColumns['aggregates'] = [{'Sum': aggregated1}]; monthColumns['cellsrenderer'] = _cellsrenderer; monthColumns['aggregatesrenderer'] = renderaggregated; monthColumns['cellsformat'] = 'c2'; monthColumns['draggable'] = false; monthColumns['groupable']=true; monthColumns['cellclassname'] = cellclass; monthColumns['cellvaluechanging'] = cellvaluechanging; //monthColumns['type']='number'; //monthColumns['columntype'] = 'numberinput'; finalArray.push(monthColumns); }
But Still no luck.
Please Help!!
UPDATE :
showgroupaggregates: false
, I have tried this property also, it does populate the Total. but total does not come upHello parthrawa,
Please review the following demo.
Let us know if you need further assistance.
Best Regards,
TodorjQWidgets Team
https://www.jqwidgets.comsorry but I am looking at the total under each column. I request please refer to my screen shot where i have created dynamic columns for Month.
Hello parthrawa,
Please review the following example whether it fits your needs.
Best Regards,
TodorjQWidgets Team
https://www.jqwidgets.comHi thanks for the help. It solved my issue to some extent but i am unable to align the total. because if user is tying new or bigger value whole number alignment goes for a toss. any idea how can i align it dynamically ?
Hello parthrawa,
Even if you align totals dynamically every time when the total number element’s (span in this case) width is bigger than the width of column’s name above them will cause a mess. I would like to suggest you to add the following code to every span element:
width: column's width; text-overflow: ellipsis overflow: hidden;
With this code every time the span’s width is bigger than what you set for width the total number will be presented with … at the end. For better user experience you could add a tooltip for every span element to show the total number.
Best Regards,
TodorjQWidgets Team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.