Make the first note about "book list". 2016-09-03 after calling modal in a table, click the Delete button in the table to eject modal, click OK to delete the function after the whole line TR is deleted.
The following table is indicated as a class of students.
1 <Tableclass= "Table table-bordered stu-tab"ID= "Stu-tab">2 <TR> <TDcolspan= "7"Align= "Left">* * Class Students</TD> </TR>3 <TR>4 <th></th>5 <th>Id</th>6 <th>Name</th>7 <th>Class number</th>8 <th>School Number</th>9 <th>Operation</th>Ten </TR> One A <TR> - <TD> - <label> the <inputtype= "checkbox"/> - </label> - </TD> - <TD>1</TD> + <TD>Pig Man</TD> - <TD>14040211</TD> + <TD>14014505</TD> A <TD> at <spanclass= "Glyphicon Glyphicon-trash"Aria-hidden= "true"Data-toggle= "Modal"Data-target= "#Stu-delete"ID= "Delete-row"></span> - </TD> - </TR> - <TR> - - </TR> in </Table>
The following is the modal of the call, using the bootstrap plugin.
1 <Divclass= "Modal Fade"ID= "Stu-delete">2 <Divclass= "Modal-dialog">3 <Divclass= "Modal-content">4 <Divclass= "Modal-header">5 <Buttontype= "button"class= "Close"Data-dismiss= "Modal"Aria-label= "Close"><spanAria-hidden= "true">×</span></Button>6 <h4class= "Modal-title">Confirm Action</h4>7 </Div>8 <Divclass= "Modal-body">9 <H3class= "Text-danger">Are you sure you want to delete this item?</H3>Ten </Div> One <Divclass= "Modal-footer"> A <Buttontype= "button"class= "Btn Btn-default"Data-dismiss= "Modal">Cancel</Button> - <Buttontype= "button"class= "Btn Btn-danger"value= "Deletealone"onclick= "DeleteRow ()">Confirm Delete</Button> - </Div> the </Div><!--/.modal-content - - </Div><!--/.modal-dialog - - </Div><!--/.modal - - <!--delete operation on modal-
This is the JS function, which implements how to delete a whole line of content.
function deleterow () { $ ("#Stu-delete"). Modal (' hide '); var i=document.getelementbyid (' Delete-row '). ParentNode.parentNode.rowIndex; Select TR for ID Dad's father document.getElementById (' Stu-tab '). DeleteRow (i); Delete TR}
Delete tr after clicking modal ok key