How to add record to jTable?

泄露秘密 提交于 2019-12-06 00:25:35
jsalonen

load method is used when you want to retrieve data to your table from server. If you want to add data by hand then addRecord is the right method to use. However: by default, jtable tries to add data also to server. If you don't have your server configured properly, then addRecord may fail too.

In this, if you just want to add data manually to the client side, provide addRecord with clientOnly parameter:

$('#jt').jtable('addRecord', {
   record: {
      a:'aaa',b:'bbb'
   },
   clientOnly: true
});

Full working demo: JSFIDDLE

Are you trying to add the data locally? According to the documentation for addRecord, you would need to specify the clientOnly option:

clientOnly (boolean, default: false): If this is true, jTable does not add record to the server, only adds to the table.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!