[Tutorial] Add new row to layui dynamic table

【Scenes】

The page calls the data table, provides an add button in the toolbar, clicks the add button, the layer pops up on the page, adds new content in the layer, clicks the save button, after adding it to the database, a new row is added to the data table

【solution】

1Add id attribute when setting data table instance

table.render({
    elem: '#table1'
    ,id: 'treload'

2 form reload

table.reload('treload',{ 
    page: { 
    curr: 1 //restart from page 1 
  } 
  ,page: false //page can be turned off 
});


Guess you like

Origin blog.csdn.net/hifhf/article/details/107311578