Exjts 4.2 get sort direction in headerclick - sorting

i am now want to get the grid column sorting direction for me to customized the sort function. May i know how i can have the sort direction in the below headerclick function.
headerclick: function(header, column, e, t,eOpts)

The grid column sorting indicator is only UI to sorters that are implemented at store level. You can access the sorters by grid.getStore().getSorters().

Related

COGNOS: How can i enable the same sort order for list and chart

Hello I have following problem. I would like to have the same order for Ratingklasse in the Chart as i it is in the List. The List has no sorting function. The Chart sorts the values correctly but from bottom to top compared to the list. As soon as i use the asc function it displays the values AA before AAA. Hase anyone a clue if i can set up something in the Chart to Show me the exact values but in a different order, expect the sorting function?
Thanks in advance
Can you try to point the list query to the query for the chart?
(Drag the list query next to the query for the chart)

Column header shows arrow icon after sortable is false in ExtJs grid

I have an ExtJs GridPanel in which sortable is false in all the columns.
Then if I sort store by
this.store.sort('Column1','ASC');
then the arrow reappers .
Does sortable gets true?
Is this because I am sorting the store or anything else?
If it the reason different than that then what is the solution for removing the arrow?
I would appreciate any help on this.
The arrow is being shown because of the sorter in the store, which identifies a column in the grid which has the dataIndex equal to the property you are sorting, despite the sorting being disable on this column. In this case, you could override the getSortParam function in your column definition, like this:
getSortParam: Ext.emptyFn
And your column will no longer show the arrow in the header.

Dgrid sorted but not sorted in the store?

when I sort the dgrid, clicking on some column header, the view of the grid changes. When for example I call "getSelectedRows" on the grid object, I get the list of selected rows but not sorted.
I need to get on the js, the list of sorted rows because I must print them in a pdf in the same sorting that the grid views the results.
Is there in dgrid a function, an object or something else to permit me to get this result?
Thank you very much!!!!!
It depends on which version of dgrid you are using, if you are using dgrid 0.3 you can get rendered data of grid like this from it's store
var sortedData=grid.store.query(grid.get('query'),{sort:grid.get('sort')});
in dgrid 0.4 you can just use_renderedCollection property of dgrid

Telerik MVC Grid: Setting the Default Sorting direction

Is there a way to specify the default sorting direction for columns in a Telerik MVC Grid?
example: click on column 'Date' and it sorts descending, click on column 'Name' and it sorts ascending
I do not think there is a way in today's Grid to change the "cycle" order for sorting operations. By default, the Grid will cycle through these sort orders when the header is clicked:
Unsorted > Ascending > Descending
If you use the API options described by Dick, you can set the initial sort behavior, but once the column is clicked, it will "resume" the cycle. So, if you set Date to Ascending initially, the next click will sort by Descending.
This is relatively common behavior for web grids, so it meets user experience expectations.
If you want to take explicit control over sorting behavior, there is a rich client-side API that allows you to specify sort and filters directly:
var grid = $('#yourGridId').data('tGrid');
//Descendingly sort the records by the Name property
grid.filter('Name-desc');
As you can see, you can specify the property name and sort direction. You can also sort on multiple fields. See the online docs for more examples.
I suppose you can play with the OrderBy method of the Telerik MVC grid and define the sort order explicitly - at least this is what I see from the demo description here.
Dick

Adding new row in correct position to a user sorted wingrid with bindingsource

I have a Infragistics UltraGrid using a bindingSource.
If I add a new object to my binding list, it adds a row to the bottom of the grid which is fine if there's no user defined sort.
Question is if the user clicks on a column header to sort the grid, is there a way for new rows to appear in the proper sorted order instead of always on the bottom?
Re-sorting all rows on every insert is too expensive.
Seems kind of ghetto. Infragistics support also indicated that the RefreshSortPosition() method is the only choice.
// Add to binding list which will trigger a row to be added to the bound ultragrid.
this.bindingList.Add(new Person("Smith", "John"));
// Get length since we know this will always be added to the end
int length = this.ultraGrid.Rows.All.Length;
// Get it to sort
this.ultraGrid.Rows[length - 1].RefreshSortPosition();
To be a bit more efficient, you can always be clever by disable redrawing, etc and then call refresh on a bunch of rows after a batch of orders, etc...
Hope that helps. I had very little luck Googling this problem.

Resources