Hi
I am having issues sorting a column with a Pivot table. It seems like dhtmlxGrid is ignoring the sorting function.
I have the following code:
function loadSales() {
var Sales = new dhtmlXGridObject('Sales');
Sales.setImagePath('javascripts/codebase/imgs/');
Sales.setHeader('Item,Date,Quantity,Salesperson,Value,Analysis Group',null,["text-align:left;","text-align:left;","text-align:right;","text-align:left;","text-align:right;","text-align:left;"]);
Sales.setColAlign('left,left,right,left,right,left');
Sales.setColTypes('ro,ro,ro_wvint,ro,ro_wvint,ro');
Sales.attachFooter('Count: {#stat_count}, , , , , ');
Sales.setColSorting('str,date,sort_wvint,str,sort_wvint,str');
Sales.setInitWidths('600,100,100,100,100,100');
Sales.init();
Sales.setSkin('dhx_skyblue');
Sales.enableSmartRendering(false);
Sales.i18n.decimal_separator=".";
Sales.i18n.group_separator=",";
Sales.attachEvent("onXLS",function(){ showProgress("prgSales", "Sales"); });
Sales.attachEvent("onXLE",function(){ hideProgress("prgSales"); });
Sales.sortRows(0);
Sales.loadXML('pagevrd.vrd?session=wblhq14970axi2g7bayfp15wcnm7oxss&objectOid=2550.168&repeatSectOID=10747.5507&page=Cust Enquiry CRM13&formAction=getData', function() {Sales.makePivot(null, {title:"Sales",titleStyle:"font-weight:bold;font-size:12px;",x:1,y:0,value:2,action:0});});
Sales.sortRows(0,'str','desc');
}
The resulting table attached.
I want to sort the first column Alphabetically, but for some reason calling sortRows before or after loading the data, makes no difference.
Is there any way I can sort columns on a pivot table?
I am using version 4.0.2.
Thanks.