how to sort prime react table? - javascript

sorting in my table is not working.
LeftIcon - sort, RightIcon - filter.
https://codesandbox.io/s/purple-feather-phzm1j?file=/src/App.js - my project
I'm assuming due to the nesting in the data, how do I set this up?

It is related to nesting of data. You have two choices...
Flatten your JSON to be more friendly to the built in sorting.
Use sortFunction on the column to write a custom sort on how that column should be sorted.

Related

SharePoint SPGridView client side available options

I've been looking in to a few grids that are currently built that I could just make use of however none that I have found so far provide the same functionality as an SPGridView in terms of filtering.
The closest I've managed to find is JSGrid which allows you to search each individual column.
What I'd like to do is to display all unique values for a specific column in the filtering option below the normal Ascending and descending much like the list view functionality you currently get in a document library or list.
Many Thanks
Truez

Sorting a knockout grid in the client

I am having trouble with what i think comes basically for free with knockout.
I have a foreach loop, done in knock out, which creates table rows.
Outside of this loop i have the table header, and i want to make the column headers trigger a client side sort.
I have seen the observable array function sort() but i cant seem to get it firing. Following up, is it hard to do ascending / descending sorts?
I was able to implement it with this post. The fiddle had just what I needed, it is a good example of the bindings needed.
Knockoutjs - Sorting a large observablearray
I extended it by including a sort direction variable in my model that i toggle when sorting.

Can javascript sort, filter, and render a very large table?

First of all, I have no idea of Javascript's capability on this. But would like to know if it is possible:
To read from a text file and display a very large table (a couple dozens of columns and a few hundred thousands of rows), in sections;
Not all columns will displayed in the same time. columns are in groups. a group of columns needs to toggle between hidden or show;
rows can be filtered based on certain columns.
The reason to do this is to make a report that displays data analysis results and also provides basic filter, sorting functions for the user. They most likely to have some sort of web browser. So HTML would be an ideal format.
Is it possible with Javascript?
Thanks!
You might be able to do this by using a grid plugin. For example, have at look at the answers to this question: JavaScript data grid for millions of rows
I would recommend a javascript table library such as DataTables. It includes sorting, filtering and pagination options.
Also it has functionality to hand off all the paging, filtering, sorting etc. that DataTables does to a server. The javascript lib DataTables then is just an events and display module. In this case, any number of rows can be handled.
So you would have all the functionality you need, with the ajax-y quick performance of the data loaded in javascript with the scale to handle any number of rows.
Server-side data processing with DataTables
Absolutely yes. Ext.JS shows how to do this very effectively. When done correctly, it is a performance optimization that reduces round trips to server. And improves UX responsiveness.
ExtJS Rich Grid Example. (there are many)
ExtJS Examples. (look at grid section)
Hope that helps.

sorting the column by clicking on the column's header

I am trying to implement one sorting functionality in my code in php. The functionality will be like, when we click on the header of a column then that particular column's record will be sorted by ascending order and again click on the same column means the column's record will be sorted by descending order.
Please help me how to proceed with some example.
JQuery has many plugins that do this sort of thing. I have used Tablesorter with great results in my own projects.
I too recommend jQuery Tablesorter, it's an excellent little plugin.
You really want to avoid doing the sorting backend, as this will put strain on your server, but if you wanted to it would be as simple as appending an ORDER BY instruction to your query depending on what column the user clicked. Again, I do not recomment this method, I think you should do it in the frontend with a plugin such as Tablesorter.

Web Page Sorting List

I'm still a novice at programming. Would like to know how I can make a sorting list for my website.Now by sorting list I mean a list on my website that has a couple of columns and rows, which the user can sort to his preference. here is an example: http://www.rugbyworldcup.com/statistics/season=2011/type=Points/team=0/player=0/statistics/index.html
Thank You
You want a sortable table. Check out the DataTables jQuery plugin. It will take a table and make it sortable and a ton of other things, and with only a 1-line config.

Categories

Resources