Editor.edit(): how to pick up data from data model

Editor.edit(): how to pick up data from data model

zipperzipper Posts: 35Questions: 9Answers: 0

I tested that the editor can pick up data by the jQuery selector from the DOM. however I cannot make it pick up data from the table object, please check if this is possible (and how). For me, edit the data model is more nature than edit the DOM. Please see http://54.199.175.35/3 for the test case. The ajax data is as bellow:

{ tb_titles:
[ 'ID',
'Product Name',
'Catalogue',
'Description',
'Create Time',
'Status' ],
tb_data:
[ { id: 1,
name: 'as_o_agent',
catalogue: 'Nibiru',
description: 'act as origination agent',
create_time: '2017-03-09T22:13:35.000Z',
status: 'active' },
{ id: 2,
name: 'as_t_agent',
catalogue: 'Nibiru',
description: 'act as termination agent',
create_time: '2017-03-09T22:13:58.000Z',
status: 'active' } ] }

Answers

  • kthorngrenkthorngren Posts: 21,570Questions: 26Answers: 4,996

    You are declaring the table variable inside the draw_table function. I don't think this variable will be available outside that function. I would declare both the editor and table variables more globally like before $(document).ready.

    Kevin

  • zipperzipper Posts: 35Questions: 9Answers: 0

    Hi @kthorngren, it is passed as a parameter to the draw_editor(table).

This discussion has been closed.