Delete tr after clicking modal ok key

Source: Internet
Author: User

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">&times;</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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.