erfangc / reacttable Goto Github PK
View Code? Open in Web Editor NEWHTML Table with Group By functionality Implemented using Facebook react.js
HTML Table with Group By functionality Implemented using Facebook react.js
The previous implementation of the table is actually fairly ripe accommodate the filtering functionality
with the latest few commits we introduced some extraneous states to the TreeNode
class. We can consolidate
Example of Redundancy:
this.display = true; // this determines whether rasterizeTree() will show the row or not
this.children = [];
this.ultimateChildren = [];
this.collapsed = this.parent != null;
this.sortIndex = null;
this.hiddenByFilter = false; // therefore this is redundant
The extraneous states is being manipulated or depended on in different parts of the library, which makes it slightly harder to reason about.
Ideally, we should minimize states and streamline dataflow, specifically: filtering should just toggle .display
property of TreeNode
objects and we will leave rasterizeTree()
to determine how to display it.
From that perspective this change should make the code base slightly lighter.
Selection impossible when in non-group by mode
We need to build unit and end to end testing for
etc ...
In the master version the plus button is now somehow either overlapping the last header cell or exhibiting other behaviors. this is likely the result of the new grand total column at the bottom of the table
By default I believe, react table uses a flat list as the data input with grouping and subtotalling done on the front end. If the data is already grouped and exists in a tree table format, we cannot render it directly using react table. it would be great if we could do so.
Sample data:
[
{
Name: "USA",
Area: 9826675,
Population: 318212000,
TimeZone: "UTC -5 to -10",
children: [
{
Name: "California",
Area: 423970,
Population: 38340000,
TimeZone: "Pacific Time",
children: [
{
Name: "San Francisco",
Area: 231,
Population: 837442,
TimeZone: "PST"
},
{
Name: "Los Angeles",
Area: 503,
Population: 3904657,
TimeZone: "PST"
}
]
},
{
Name: "Illinois",
Area: 57914,
Population: 12882135,
TimeZone: "Central Time Zone",
children: [
{
Name: "Chicago",
Area: 234,
Population: 2695598,
TimeZone: "CST"
}
]
}
]
},
{
Name: "Texas",
Area: 268581,
Population: 26448193,
TimeZone: "Mountain"
}
];
Selection disappears when collapsing then collapsing sectors
After moving from ReactTable 2.2.8 to 3.0.4 the group by functionality has stopped working.
The following warning is displayed in the console log:
Each child in an array should have a unique "key" prop. Check the render method of ReactTable. See http://fb.me/react-warning-keys for more information.
I can confirm that the data does not contain duplicate rows as I added a unique key for each row.
Also tried changing the rowkey option to use the unique key without success.
HI
Is this plugin available in npm ? And is it compatible with latest version of React i.e 0.14...
Thank you
Many existing tables like datatables have server-side pagination. Even though, react table is capable of performing aggregation operations on massive amounts of data on the front end, it would be a great feature since sending huge amount of data over network might clog the bandwidth, thus need to be able to perform sorting or summarizing in the backend.
Tried exporting to excel for a dataset with 12000 rows and 12 columns.
It causes chrome to crash.
currently sorting only works on the detail level. client code can pass in custom sort routines through the sort
property to columnDef
objects
the callback function is then called by the internal master sorting function sorterFactory()
see SortUtil.js
inside the master sorting routine you will see that sector sorting takes a callback as well.
currently the default implementation for sector sorting only sort on sector path. (since we need sector paths of summary rows to be in the correct order to render the table correctly, i.e. a child summary row is always suppose to come after the parent summary row in the data
array)
the challenge here is to be able to sort both on sector path and by some arbitrary criteria (such as the aggregated value of a column)
Does a reactTable function exist which allows the data to be updated?
In version 3.0.4 the replaceData function no longer exists. Looking at the code I can't find anything
which performs a similar function.
Selectively Disable:
Add Button
Remove Button(s) in the Menu
The Ability to Summarize
Sorting
Disable Grand Subtotaling
Need an Input box on each column(on a right click or any other operation) which will have the dropdown list of all the distinct values for that column.When a user selects a particular value, then the table should only show rows havingthe column value equivalent to the filter.
There can be multiple scenarios in which you want to filter on a column in other ways than writing the text in a search box, for example, double clicking on a cell content.
may just need register to listen to window.resize events when the component mounts?
the current table seems significantly slower than before, as discussed with @wenjiechen this appears to be caused by adjustHeaders()
we either have to reimplement the header and grand total footer using a method that does not rely on adjustHeader()
OR we have to investigate why adjustHeader()
is suddenly slowing the widget down significantly more than before
new branch created to incorporate the following changes
Need cells which can support hyperlinks or images.
Other columns are fine
Not responsive to change in the window size
{..., selectedKeys: value, ...}
value should be an array of "rowKey"s so when the table is created, it will have rows selected automatically that may have been previously selected
Need to be able to sort on multiple columns.
enhance look and feel since bootstrap dependency has been removed
Row callbacks work but we need to perform cell specific operations if the user clicks on a particular cell of the row like right click or double click on a cell which will work as a filter, etc..
this causes subtotal by date field failure. please look at this issue
i.e. An ascending numerical sort can end up as ["","","",100,150,200]
There should be group by option when initializing React table itself to avoid the // on the column header.
Anomalies such as (64/63) occur if you have a field without data
To provide custom formatting or having a format mapper which maps to shortcuts
Aggregating/de-aggregating tree will call custom callback with aggregation state if passed in upon initialization
Data is left unformatted
in the front end, experotToExcel can't handle large size of data. we can add an ajax api to send the data to backend and generate download excel. If this api defined by user, we call this api, otherwise we use experotToExcel method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.