Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The values for each cell in that row are: [object Object] #97

Open
tw15tr opened this issue Aug 20, 2021 · 2 comments
Open

The values for each cell in that row are: [object Object] #97

tw15tr opened this issue Aug 20, 2021 · 2 comments

Comments

@tw15tr
Copy link

tw15tr commented Aug 20, 2021

updatedRow.data() is returning [object Object]

Any ideas why?

var ResultsTable = $("#resultstable").DataTable({ lengthChange: true, pageLength: 25, filter: true, deferRender: true, responsive: true, processing: true, language: {"zeroRecords": " "}, columns: [{ "data": "ifName" },{ "data": "alias" },{ "data": "operStatusStr" },{ "data": "adminStatusStr" }, { "data": "ReservedBy" }, { "data": "ReservedDescription" }, { "data": "ReservedDate" } ] });

function myCallbackFunction (updatedCell, updatedRow, oldValue) { console.log("The new value for the cell is: " + updatedCell.data()); console.log("The values for each cell in that row are: " + updatedRow.data()); }

ResultsTable.MakeCellsEditable({ "onUpdate": myCallbackFunction, "inputCss":"my-input-class", "columns": [5], "allowNulls": { "columns": [5], "errorClass": "error" }, "confirmationButton": { "confirmCss": "my-confirm-class", "cancelCss": "my-cancel-class" } });

output:

The new value for the cell is: test
The values for each cell in that row are: [object Object]

@jonack70
Copy link

any solutions to this?

having same issue

@jonack70
Copy link

figured it out-- you just need JSON.stringify(updatedRow.data() and it works great.
(your data is a JSON object and needs to be converted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants