using aaData in editor for comparison

using aaData in editor for comparison

vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
edited February 2013 in Editor
Hi Allan,
I was trying to compare the form data with available data in table within "events": {"onPreSubmit":....}
and doing some comparison like this
if (aaData[i].id!==o.data.id){}
But I get error as " aaData is not defined". Let me know the reason please.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Just as the error says, aaData is undefined. What did you expect it to be? I guess you don't have a global, or at least a locally accessible, variable called aaData.

    Allan
  • vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
    Thank you Allan,
    As you told once i made it global and successfully accessed within preSubmit event. But I facing another issue now, aaData does not match with the edited/created/deleted values. What I can do to make a real time comparison?
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    I suspect you would want to get aaData again from the table using fnGetData once the table has been updated.

    At the moment independent copied of the data are used in DataTables which is likely the issue. That will not be the case in DataTables 1.10.

    Allan
This discussion has been closed.