数据表添加更新删除和编辑

时间:2018-08-10 22:41:55

标签: javascript jquery html json datatables

我的问题是关于如何编辑,删除和添加数据表中的数据 jsfiddle CODE

<table id="example" class="display" cellspacing="0" width="100%">
<thead>
    <tr>
        <th>Test</th>
        <th>Description</th>
        <th>Result</th>
        <th>Start Time</th>
        <th>End Time</th>
    </tr>
</thead>

$(document).ready(function (){
var table = $('#example').DataTable({
    "ajax": "https://api.myjson.com/bins/575cy",
    "columns": [
        { "data": "tId" }, 
        { "data": "description"}, 
        { "data": "rst" }, 
        { "data": "startDate" }, 
        { "data": "endDate"}
   ]        
});

});

1:在上面的链接中,有一个我想知道是否可以添加,更新和删除数据的人的代码。

2:我还想知道更新,删除和编辑将如何更改json页面上的数据,因此在刷新或重新打开页面后,我看到的是更新的而不是以前的数据。

EIDTED ::我也有一个与servlet和JSP一起使用的MySQL数据库,如果有人可以帮助我找到关于同时使用数据表,以及编辑和删除的解决方案……

希望我已经正确地清理了自己。

0 个答案:

没有答案