Our blazing fast Grid component built with pure JavaScript


Post by suhas.kachare »

Hi Team ,

I want to assign my custom editor to a column inside the beforeCellEditStart event . I followed the syntax given in the below documentation but it is not working.

https://www.bryntum.com/docs/grid/api/Grid/feature/CellEdit#choosing-field-on-the-fly

({ editorContext }) => {
    return editorContext.editor = new TextEditor();
};

in above code TextEditor is my custom editor written in react class based component .


Post by alex.l »

Hi suhas.kachare,

It won't be working like this for React components. Check React Basic Grid demo for code example how to use it.
To have all our demos code, download sources from Customer Zone (or if you are trial, you already have it), and check /examples/frameworks/react/javascript/basic folder to find and example I mentioned.
https://www.bryntum.com/docs/grid/guide/Grid/integration/react/guide#using-react-as-cell-editor

        columns: [
 
        {
            field: 'original',
            text: 'Original<div class="small-text">(React editor)</div>',
            htmlEncodeHeaderText: false,
            align: 'center',
            width: 120,
            renderer: ({ value }) => (value ? 'Yes' : 'No'),
            editor: (ref, instance) => <DemoEditor instance={instance} ref={ref} />
        },

All the best,
Alex


Post Reply