wmira / react-datatable

Datatable component written using react view framework
https://github.com/wmira/react-datatable
MIT License
56 stars 8 forks source link

Implement Common Cell Editors #10

Open wmira opened 9 years ago

wmira commented 9 years ago

We should be able to implement this cleanly with the new datasource implementation

  1. An Up/Down value editor. If its a number then this up/down toggle can increment and decrement the value
  2. A Select/Key Value editor.
  3. A Calendar Editor
bebraw commented 9 years ago

It would be handy if it was possible to customize this per column. Let's say you have a Country column, in that case you would probably like to offer a country listing with countries to select from. Ideally you should be able to define custom editors through configuration like this:

config = {
    style: 'pure',
    cols: [
        {
            property: 'country', editable: true, header: 'Country', editor: countryEditor
        }
    ]
};

...

function countryEditor() {
    ... // this would return JSX needed to edit a country, ie. a drop-down with countries
    // and deal with the selection. you'll need to define some standard semantics for this
}

...
bebraw commented 9 years ago

Another thought... What if you want to display a color at a cell? Just making it possible to define a custom editor wouldn't be enough. You would need to be able to customize the way the values are displayed.

I can open a separate issue for this if you want.