使用引导程序图标添加,删除,编辑行

时间:2014-03-16 10:38:14

标签: jsp

这里是我的编码....我想添加一个带有现有图标的新行并编辑,通过在jsp中使用ajax单击bootstrap图标来删除行

单击添加图标时,应在该行的下方创建新行,并将数据添加到该行中,

单击删除图标时,必须删除整行

单击编辑图标时,用户可以编辑数据,它将在表格中更改。

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Employee Details</title>
<link rel="stylesheet" type="text/css" href="C:\eclipse-jee-galileo-SR2-win32(1)\eclipse\work\table\bootstrap\bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="C:\eclipse-jee-galileo-SR2-win32(1)\eclipse\work\table\bootstrap\bootstrap/js/bootstrap.min.js"></script>
<style type="text/css">
    .bs-example{
        margin: 20px;
    }
</style>
</head>
<body>
<form class="well form-search">
  <input type="text" class="input-medium search-query">
  <button type="submit" class="btn" ><i class="icon-search"></i>Search</button>
</form>
<div class="bs-example" id="parentdiv">
    <table class="table table-hover" id="t1">
        <thead>
            <tr>
                <th align="center">Employee Id</th>
                <th align="center">Employee Name</th>
                <th align="center">Employee Designation</th>
                <th align="center">Employee salary</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td id="e1"> 1001</td>
                <td id="n1"> John</td>
                <td id="d1">Chennai</td>
                <td id="s1">60000</td>
                <td> <form>
        <div class="btn-group">
                <button type="button" class="btn btn-default btn-lg"><i class="icon-plus"></i></button>
                <button type="button" class="btn btn-default btn-lg"><i class="icon-edit"></i></button>  
                <button type="button" class="btn btn-default btn-lg"><i class="icon-trash"></i></button> 
                </div>
                </form>
            </tr>
            <tr>
                <td id="e2">2</td>
                <td id="n2">Peter</td>
                <td id="d2">chennai</td>
                <td id="s2">40000</td>
                <td><form>
                 <div class="btn-group">
                <button type="button" class="btn btn-default btn-lg"><i class="icon-plus"></i></button>
                <button type="button" class="btn btn-default btn-lg"><i class="icon-edit"></i></button>  
                <button type="button" class="btn btn-default btn-lg"><i class="icon-trash"></i></button> 
                </div>
                </form>
                </td>
            </tr>
            <tr>
                <td id="e3">3</td>
                <td id="n3">John</td>
                <td id="d3">chennai</td>
                <td id="s3">30000</td>
                <td><form>
                 <div class="btn-group">
                <button type="button" class="btn btn-default btn-lg"><i class="icon-plus"></i></button>
                <button type="button" class="btn btn-default btn-lg"><i class="icon-edit"></i></button>  
                <button type="button" class="btn btn-default btn-lg"><i class="icon-trash"></i></button> 
                </div>
                </form>
                </td>
            </tr>
        </tbody>
    </table>
</div>
</body>
</html>                                     

0 个答案:

没有答案