I have a problem in sorting on a clir inea datatable except that the datatable component that of it uses custumized js functions to do the sorting and never takes alphanumerics into account.
I tried to properly sort the stakes column (I was implementing an algorithm ) except that I noticed that this one overwrites the normal operation of the component which allows sorting for the other columns of the table.
there is any solution on clir datatable for sorting alphanumerics column??
Here is descending and ascending sorting
Related
A stupid thing that got me cracking my head. I'm sure you'll laugh, but how do I
sort a sheet without including the first row in the sort?
Here's my code:
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("test1");
spreadsheet.sort(4); // or spreadsheet.sort(4,false); or spreadsheet.sort(4,true);
This sorts by column D, but it also sorts the first row. Column D contains only text.
Funny thing is that if you sort a column which has just numbers/dates, it works and it indeed avoids sorting the first row.
So, how can I sort a column with text and avoid sorting the first row?
I know that I can set a range start at A2 until the last column but this seems "messy". Something like this
spreadsheet.getRange('A2:AI').sort({column: 4, ascending: true});
Thanks
What about this solution:
Freeze the header row and then perform the sorting operation.
In this way it's easy and readable to select the row that will contain the headers of your spreadsheet and you can apply all the sorting operations with a cleaner syntax:
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("test1");
spreadsheet.setFrozenRows(1);
spreadsheet.sort(4);
Reference
.setFrozenRows()
You'll probably find this "messy" too but maybe you could save the first item, sort your column and insert back the first item ?
About the working sort of dates/numbers, maybe the sheet detects that the first cell is the only different one (not a number or a date) and then don't sort it ?
I have implemented laravel dataTable as a service.
The initial two columns are actual id and names so, I am able to sort it asc/desc after the table renders.
But the next few columns renders after performing few calculations, i.e. these values are not fetched directly from any column rather it is processed.
I am unable to sort these columns where calculations were performed, and I get this error. And I know it is looking for that particular column for eg outstanding_amount which I don't have in the DB, rather it is a calculated amount from two or more columns that are in some other tables.
Any Suggestions on how to overcome this issue?
It looks like you're trying to sort by values that aren't columns, but calculated values.
So the main issue here is to give Eloquent/MySql the data it needs to provide the sorting.
// You might need to do some joins first
->addSelect(DB::raw('your_calc as outstanding_amount'))
->orderBy('outstanding_amount') // asc can be omitted as this is the default
// Anternative: you don't need the value sorted by
// Don't forget any joins you might need
->orderByRaw('your_calc_for_outstanding_amount ASC')
For SQL functions it'll work as follow
->addSelect(DB::raw('COUNT(products.id) as product_count'));
->orderByRaw(DB::raw('COUNT(products.id)'),'DESC');
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?
I have this table:
When executed, it looks like:
This table is sorted by alphabetical order. I would like to sort it by the column named "No Vencido", which is generated in runtime combining 2 dimensions of a cube (one dimension is called "Class 1", the other dimension is called "value".
How can i sort a table by an autogenerated field?
Thanks
You can sort by any sort of expression - SSRS will quite happily sort something like two fields concatenated together:
=Fields!Class1.Value & Fields!value.Value
Just be careful to make sure the sorting is applied at the appropriate level to avoid unexpected, i.e. make sure you don't have different sorting expressions in any row group or detail group if not required.
If No Vencido is the grouping expression, apply the sorting at the group level.
If you don't want to sort on an expression, you can create a calculated field for each row in the dataset with the expression =Fields!Class1.Value & Fields!value.Value and group/sort on that calculated field as required.
Edit after comment
OK, I think you need to apply a sort expression like this to the groups that apply to the Top and Otros rows:
=Sum(IIf(Fields!Clase_1.Value = "No Vencido", Fields!Monto.Value, Nothing))
This is still sorting by the total Monto for each row group, but only considering the rows where Clase_1 is No Vencido.
Once this is set up sort by A-Z or Z-A as required.
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".