Sort field in Drupal 7 - sorting

I have a content type for which I created a field. I want to sort random field items. My previous topic is Sort random field items via jQuery.
I want to learn how to randomly sort, via template.php, or other Drupal solution.
How can I randomly sort my field items?

Create a view using contrib Views module that would output the fields that you are interested in sorting.
Now in the view you can select random sort. This option is available in Sort option as "Global: Random".

Related

ExtJS 6 Sort grid Panel groupings by the summary rows

My purpose consist in to do sort ascending / descending the groups by its summary instead of their raw data as usual.
There is another similar issue about this, but the solution that was given, doesn't fit what I need.
Using that same fiddle as an example: https://fiddle.sencha.com/#fiddle/1im3, how can I do sort by the summary of 'Estimate' column, rearranging the grouped data by the 'Project' column?

Is it possible to create a custom sorting key at the column level in a MediaWiki table?

Using https://www.mediawiki.org/wiki/Help:Sorting and other similar guides, I see that it's possible to assign a custom sorting key to specific rows using data-sort-value. Is it possible to create a key at the column level that will sort all data in that column by that key?
The end goal is to be able to take a column of data that uses alphanumeric characters and sort them in a way makes sense in context as opposed to the default alphabetic or numeric options available with data-sort-type. Since many tables on the site will be using the same sorting key for this particular column, it makes more sense to apply it at the column level than to each row of every table.
Alternatively if MediaWiki doesn't have the above sorting feature, is it possible to create a custom data-sort-type in MediaWiki? If so, where would I start?

Sorting on hidden data

Is it possible to have data in a Handsontable sorted by a field which is not displayed? I have a grid of data which I would like to display that contains a column called "sortOrder", but I don't want to display this.
The sorting needs to be done client side because events are coming in over web sockets and need to be reflected in the table.
If you're not showing the column then I assume you're not expecting the user to be able to manually sort by this hidden column. Therefore, why don't you simply sort your data array with native JS? At any point during execution you could have a function which sorts by this hidden column and then just don't render this in your Handson definition.
So yes, the answer is it is possible. The not showing of a column is as simple as defining the columns option and not including a column for this hidden value.

Sorting the values in a listbox when using an expression in the sort tab in Qlikview

I want to know if anyone knows how to sort the values in a listbox in Qlikview, when one is forced to have an expression in the sort tab?
I had to use the same expression from the general tab in the sort tab
if(datakilde='Aarlig', Aktivitetsnavn)
Otherwise the listbox didn't show the associated values (from a selected value from another listbox) in the top of the listbox - which aren't very user friendly.
But as a consequence the sorting in alphabetic order is no longer works...
(And I had to have an expression in the general tab, becausecI only need a subset of the loaded data).
(I also tried with the option auto ascending in the state box under the sort tab).
See my sort tab below.
Kind Regards Maria
There are multiple solutions on this, but I think the correct one, would be to create a field in your datamodel, that contains just the values that need in the listbox.
Listboxes are not very good at filtering data. So take your if statement, and put it into the source table:
if(datakilde='Aarlig', Aktivitetsnavn) as Aktivitetsnavn_2
Then you don't have to struggle with filtering data in listboxes and your sorting will be correct.
i had similar problem while sorting a listbox with values filtered by an expression. I gave up on filtering in listbox and filtered in my load script. After that i was able to sort properly.
A solution for a similar situation I just had was the following:
I've loaded all Items that i needed sorted & filtered out in a separate table, for example:
zones:
LOAD * INLINE [
zone, **zone_order**
zone A, 1
zone D, 2
zone C, 3
zone B, 4
];
I've added my zone in the filter and in the Sort tab, i've chosen to sort by expression: zone_order, and that's it!

RDLC sorting on multiple columns

I want to sort an rdlc report by two or more columns.
This could happen if I have two names that are the same so then it should next be sorted by ID column.
When I navigate to textbox properties and click the interactive sort tab I can only select one column to sort by.
How to add more than one column?
EDIT: I just realised you can edit the matrix of the entire table to add multiple sort fields. I'm guessing you can also create a group and attach that to the column if needed.
I also did not find multiple columns fields for interactive sorting.
You can workaround this by specifying an expression where you concatenate columns values. Note that date field you have to format in a sort friendly way.
=Fields!MyString.Value & CDate(Fields!MyDate.Value).ToString("yyyyMMdd")
yes, you can add multiple sort fields in the tablix properties.
Aside from that, if you click on a row textbox, you can see the Interactive Sorting tab, where you can group and sort field values.
Hope this helps!

Resources