Posted 14 September 2017, 11:22 am EST
Hello
i’m using a FlexGrid and i would disable sorting on initial data source.
Is it possible ?
Thank you for all
bye
Forums Home / Wijmo / General Discussion
Posted by: loicgeo on 14 September 2017, 11:22 am EST
Posted 14 September 2017, 11:22 am EST
Hello
i’m using a FlexGrid and i would disable sorting on initial data source.
Is it possible ?
Thank you for all
bye
Posted 14 September 2017, 11:22 am EST
Hello Loicgeo,
I am not clear with your requirement. If you want to disable sorting on FlexGrid then you can set its allowSorting property to false or cancel the sorting in sortingColumn event.
At collectionView level, you can clear the sortDescriptions collection to remove the sorting. If it does not help then kindly elaborate on your requirement so that I can suggest you accordingly.
Regards
Posted 14 September 2017, 11:22 am EST
Thank you for your reply, was useful for me ;o)
Posted 14 September 2017, 11:22 am EST
Hi Ashish,
I just want to disable column sorting on a particular column, is that possible? I tried allowSorting= false, however it disables the sorting for entire FlexGrid.
Any code example?
Posted 14 September 2017, 11:22 am EST
Hi Nitin,
My apologies for the late reply. I hope that this reply is still useful to you.
Please try the following code to disable sort on a particular column
$scope.sortingColumn = function(sender, args) { // determine new sort if (sender.columns[args.col].binding=="age") { args.cancel = true; } }
<wj-flex-grid items-source="data" selection-mode="Row" sorting-column="sortingColumn(s,e)" item-formatter="itemFormatter"> <wj-flex-grid-column header="Name" binding="name"></wj-flex-grid-column> <wj-flex-grid-column header="Age" binding="age"></wj-flex-grid-column> </wj-flex-grid>
Thanks,
Abhishek
Posted 14 September 2017, 11:22 am EST
Hi,
actually i want to hide sorting options(ascending descending) for one column.How can that be possible?Or if it is possible to hide whole filter
Posted 14 September 2017, 11:22 am EST
any update on this?
Posted 14 September 2017, 11:22 am EST
Hi Dharna,
You can remove from particular column by setting FilterType to None for specified column.
You can also hide sort button for specific column by hiding in filterChanging event.
For your reference, please see the attached sample that implements the same.
Thanks,
Manish Kumar Gupta
2017/05/FlexGrid_filter_sortButton.zip
Posted 5 February 2020, 12:26 pm EST
Hi ,
I want to disable sorting in wijmo flex grid but in column level.
I used allow-sorting=“false” . but it didnt work.
below is my column of wijmo .where I donot want to sort the colum.
<wj-flex-grid-column
binding=“irsmstatusName”
header=“IRSM Status”
[dataMap]=“statusMap”
[width]=“210”
>
<ng-template wjFlexGridCellTemplate cellType="ColumnHeader" let-cell="cell" let-item="item"> <div> <div> <label class="">IRSM Status</label> </div> <div> <wj-combo-box [itemsSource]="status" [(selectedItem)]="cell.value" [isEditable]="false" > </wj-combo-box> <button [wjTooltip]="'copy below'" style="align-items: center;padding: 0px !important" class="btn btn-light" (click)="onCopyBelowClick('irsmstatusName', cell.value)" > <span> <fa-icon icon="level-down-alt"></fa-icon> </span> </button> </div> </div> </ng-template> </wj-flex-grid-column>
Thanks,
Vishakha
Posted 6 February 2020, 4:57 am EST
Hi Vishakha,
The allow-sorting property is used in AngularJS. In Angular, to disable sorting in a column, set its allowSorting property to false as follows:
<wj-flex-grid-column [allowSorting]="false" header="Amount" binding="amount"></wj-flex-grid-column>
https://stackblitz.com/edit/angular-kvasq5
Regards,
Ashwin