How to sort column in IgniteUi Pivot Grid.
I need an API so that I can set the sorting of column when grid loads.
Any quick repsonse will be appreciated.
Hello Lax,
I'm just following to see whether you were able to meet your requirement with the sample which I provided to you.
Let me know if you have further questions regarding this subject.
Best regards,Martin PavlovInfragistics, Inc.
The sorting using the UI is done by an instance of $.ig.OlapTableView class, but this instance is private to the igPivotGrid. Still you can use it to sort a column in igPivotGrid.dataSourceInitialized event.
Here is an example code:
dataSourceInitialized: function (evt, ui) {// expand the first members in the rows and in the columns in order to observe the applie sortingui.owner.expandTupleMember("rowAxis", 0, 0, false);ui.owner.expandTupleMember("columnAxis", 0, 0, true);//NOTE: ui.owner._tableView is initialized with the previous line so it's safe to use it here. However it won't work if the columnAxis is not expandedui.owner._tableView.columnSortDirections([{"memberNames":["[Product].[Product].[ProductCategory].&[All Products]&[Clothing]"],"tupleIndex":1,"sortDirection":"descending"}]);ui.owner._tableView.initialize();}
Attached you can find the complete sample.
Hope this helps,Martin PavlovInfragistics, Inc.
I went through your sample..There is no property through which I can sort column.
I tried all the sorting properties and all of them work for dimensions, none of them are for column.
When you click on column it sorts fine but I need the property so that I can set it during initialization to automatically sort it.
This functionality is demonstrated in the following sample: http://igniteui.com/pivot-grid/sorting