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.
  • Replied 9 December 2020, 7:56 am EST

    So the dv.getSelections()[0].columns[0] was able to get me the column, but if I use the tab, it keeps the 1st row selected and this method will return me the original cell

    I need to be able to determine the column that is being editted when tabbed into
  • Replied 9 December 2020, 6:44 pm EST

    Hi John,

    We are able to replicate the issue at our end hence we have forwarded it to the concerned team for further investigation. We will update you regarding this as soon as we get any information. The internal ID for this issue will be JSVIEW-698.

    Regards
    Avinash
  • Replied 10 December 2020, 2:14 am EST

    I was able to add a focuschange handler

    private focusChangedDataView(sender: any, args: any): void {
    this.currentColumn = args.column;
    // console.log(args);
    }
  • Replied 16 December 2020, 12:18 am EST

    Hi John,

    We are glad to know the issue has been resolved at our end. Please feel free to contact me if you have any further queries. Further, we will update you regarding the SelectionChanged with tab issue here.

    Regards
    Avinash
  • Replied 16 December 2020, 12:15 am EST

    Hi John,

    The Dev team is curious about your use case. Could you please provide a use case. the team just wants to know what kind of functionality you are trying to achieve by getting the currently editing Cell.

    Regards
    Avinash
Need extra support?

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

Learn More

Forum Channels