Comments (3)
You are absolutely correct. Didn't realize that this was due to casing! I was looking all over the place in the code..
I like Proposal 2 with the warnings.. if it makes a difference.
Additionally, would it be possible to scope the store names? dataSource, grid, etc are very common names.
Would be nice if it was prefixed by rrg-dataSource, rrg-grid, rrg-bulkActions, etc..
As the default for any app would be to provide an existing store.
Thanks for the fast feedback.
Hoping this grid will work for me!
from react-redux-grid.
@kkwak thanks for posting the issue; I know what the immediate problem is, and it's not your configuration, as you inferred.
The quick fix is this:
Rather than doing as the documentation suggests:
import { Reducers } from 'react-redux-grid';
const myReducers = {
myCustomReducer,
....Reducers
};
Do this:
import { Reducers } from 'react-redux-grid';
const gridReducers = {
dataSource: Reducers.DataSource,
editor: Reducers.Editor,
errorHandler: Reducers.ErrorHandler,
filter: Reducers.Filter,
grid: Reducers.grid,
loader: Reducers.Loader,
menu: Reducers.Menu,
pager: Reducers.Pager,
selection: Reducers.Selection
};
export const rootReducer = combineReducers({
app,
...gridReducers
});
This will fix your issue.
The coming fix for grid
I haven't decided how I'm going to fix this. Currently there are two components that read state out of the store -- the stateGetter
utility, and the shouldComponentUpdate
function for the central grid
component. The stateGetter
function is case insensitive, and thus didn't break, however, the shouldComponentUpdate
function isn't case insensitive (yet).
Proposal 1
Make shouldComponentUpdate
case insensitive. This is the simpler fix, and it makes the grid more fault protective, but it also slows down performance because it has to normalize values on every function call -- this is mitigated somewhat, by only checking for case sensitivity if the values don't match on first run.
Proposal 2
Update the core exports to correct casing on the reducers => Reducers.DataSource
would be Reducers.dataSource
. This is the cleaner fix, but it would break current users of the grid.
The Reducer list would look as follows:
const Reducers = {
dataSource: datasource,
grid: grid,
bulkActions: bulkaction,
editor: editor,
errorHandler: errorhandler,
filter: filter,
loader: loader,
menu: menu,
pager: pager,
selection: selection
};
I'm going to think about this for a couple days before I commit the changes. I also may allow for both for a short time, emitting console warns
until the next major release.
Let me know if the fix above doesn't work, but I'm almost certain that's the problem.
from react-redux-grid.
Awesome! Glad that worked for you. I think I'm going to go with proposal 2, allowing for case insensitivity for the short duration.
Also, I love the idea of namespacing the reducers. However, this will also be a breaking change, so it will need to be made as a separate MR with full documentation of the changes. I will do that after I make the changes for the casing issue.
Thanks!
from react-redux-grid.
Related Issues (20)
- how to refresh with remote dataSource from another action HOT 2
- Custom look of GRID_ACTIONS elements
- Assigning a property of sortable: true and defaultSortDirection: ASC|DESC does not sort the table by default HOT 1
- EditorActions.addNewRow documentation or sample code HOT 2
- Align header columns with table's contents HOT 2
- Nested Grids using react-redux-grid
- Nested object property as column value HOT 2
- PropTypes (oneOf) error when loading the Grid
- Include react-redux-grid in existing project where also uses HTML5 backend causes problem.
- Include react-redux-grid in existing project where also uses HTML5 backend causes problem. HOT 1
- Unable to remove "Edit" item from grid actions HOT 2
- Is there a way to prevent a node from moving? HOT 3
- Pass store to Grid HOT 3
- incorrect selection of indexes when selecting row
- Is there a way to add custom edit/delete button?
- too small select checkbox
- @types/react-redux-grid HOT 1
- rowIndex in tree mode
- Tree, selection throwing an mutation exception on action @@react-redux-grid/SET_SELECTION
- Instead of disabling actions can we hide it from the the action menu? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-redux-grid.