Need help for using editor datatable as React components.

Need help for using editor datatable as React components.

Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0

Hi Allan,

As discussed in this post, https://datatables.net/forums/discussion/44963, I need to use datatables with react, but how can i use editor datatable with react?? and How events can be handled in editor window for creating, deleting, editing?? How to start with editor datatables in react??

Thanks & Regards,
-SHASHIDHAR

Replies

  • Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0

    Hi Allan,

    I did some R&D, and tried to build a react component which will display a DataTable, and the got the result as in screenshot

    But, if i want edit a row, i get a error message in console saying Uncaught Unable to find row identifier For more information, please refer to https://datatables.net/tn/14
    which says Unable to find row identifier will occur when Editor is unable to find the uniquely identifying value.

    JSON i get from the API is,
    {"draw":0,"recordsTotal":57,"recordsFiltered":57,"data":[{"DT_RowId":"row_1","first_name":"Tiger","last_name":"Nixon","position":"System Architect","office":"Edinburgh","start_date":"25th Apr 11","salary":"$320,800"},{"DT_RowId":"row_2","first_name":"sgaa","last_name":"hfdhffh","position":"Accountant","office":"Tokyo","start_date":"25th Jul 11","salary":"$170,750"},{...}]}

    can you please help me out..

    Debugger is not helping me, it says DataTables is not available on this page.

  • Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0

    Hi Allan,

    Actually, 'idsrc': 'id' was the mistake i did, now i figured it out. now its working fine. thanks

  • allanallan Posts: 52,290Questions: 1Answers: 7,966 Site admin

    Thanks for posting back - good to hear you've got it working now.

    Allan

  • Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0

    hi allan,

    since DT debugger is not helping me with react, how to debug, if any help

    thanks & regards,
    -shashidhar

  • tangerinetangerine Posts: 2,661Questions: 21Answers: 303

    Debugger is not helping me, it says DataTables is not available on this page.

    You are supposed to run the DT debugger on a browser window which is showing a DT
    table.

  • Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0
    edited February 2018

    hello @tangerine, am running DT debugger on a browser window which is showing the datatable, u can have a look at screenshot attached. But still DT debugger says DataTables trace debugger DataTables is not available on this page.

  • allanallan Posts: 52,290Questions: 1Answers: 7,966 Site admin

    No screenshot attached. Perhaps your jQuery isn't available in the global name space for the page? We'd need a link to the page showing the issue to be able to offer any help.

    Allan

This discussion has been closed.