Dataview

Posted by: johngiblin on 28 October 2020, 7:12 am EST

  • Posted 28 October 2020, 7:12 am EST

    Is there a way to edit one cell at a time with the DataViewJS?

    Thanks

    John
  • Replied 29 October 2020, 1:34 am EST

    Hi Jhon,

    You may use editMode to edit a single cell at a time. Please refer to the following code snippet and the attached sample that demonstrates the same.

    let dv = new GC.DataViews.DataView(
    "#grid",
    data,
    columns,
    new GC.DataViews.GridLayout({
    allowColumnResize: true,
    allowColumnReorder: false,
    showRowHeader: false,
    editUnit: "cell",
    selectionUnit: "cell",
    allowEditing: true,
    editMode: "inline"
    })
    );

    sample: https://codesandbox.io/s/dvjs-sample-forked-9l154?file=/src/index.js:491-778

    References:
    Editing Demo: https://www.grapecity.com/dataviewsjs/demos/Features/Editing/EditorMode#


    Regards
    Avinash
  • Replied 29 October 2020, 3:20 am EST

    That is exactly what I was looking for.

    I see in the onEditing what the row is being editted, but I do not see how to get the column. Is there a way to get the column as well
  • Replied 2 November 2020, 1:09 am EST

    Hi,
    You may use getSelections method for getting the column. Please refer to the following code snippet and let us know if you face any issues.


    dv.editing.addHandler((args) => {
    console.log(dv.getSelections()[0].columns[0]);
    });




    API Refrences:

    getSelections: https://www.grapecity.com/dataviewsjs/api/classes/core.dataview.html#getselections


    Regards
    Avinash
  • Marked as Answer

    Replied 2 November 2020, 2:22 am EST

    Thank you Avinash.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels