最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

BootStrap給table表格的每一行添加一個(gè)按鈕事件

 更新時(shí)間:2017年09月07日 11:47:36   作者:xingxuexue  
這篇文章主要介紹了BootStrap給table表格的每一行添加一個(gè)按鈕事件的相關(guān)資料,需要的朋友可以參考下

1.在列屬性中加入事件

        {
          title:'數(shù)據(jù)量序號(hào)',
          field:'sjid'
          // hidden:true
        },{
          field: 'operate',
          title: '操作',
          width: '80px',
           events: operateEvents,
          formatter: operateFormatter
        }

2.寫一個(gè)函數(shù)

 function operateFormatter(value, row, index) {
    return [
    '<input type="submit" value="上傳" class="RoleOfedit btn btn-primary btn-sm"   data-toggle="modal" style="display:inline">',
    ].join('');
  }

3.記得這個(gè)寫在表格的前面

 window.operateEvents = {
     'click .RoleOfedit': function (e, value, row, index) {
        alert(row.qxxh);
        $("#upload").modal('show');
      }
    };

4.點(diǎn)擊“彈出模態(tài)框”

<div class="modal fade" id="upload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <form action="http://localhost:8080/GD/UploadAction_execute.action" method="post" enctype="multipart/form-data" name="uploadfile">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title" id="myModalLabelfile">上傳文件</h4>
      </div>
      <div class="modal-body">
          <input type="file" name="my" id="file" value="瀏覽" style="display: none;"
           onchange="document.uploadfile.filePath.value=this.value"/>
           <input type="text" name="filePath" id="filePath"/>
           <input type="button" value="瀏覽..." onclick="document.uploadfile.my.click()"/><br>
          <input type="submit" value="上傳" id="shangchuan">
      </div>
          <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">關(guān)閉</button>

      </div>
    </div>
    <!-- /.modal-content -->
  </div>
  <!-- /.modal -->
  </form>
</div>

總結(jié)

以上所述是小編給大家介紹的BootStrap給table表格的每一行添加一個(gè)按鈕事件,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

阳谷县| 旌德县| 南昌市| 革吉县| 合山市| 华坪县| 武义县| 南雄市| 岑溪市| 都江堰市| 江都市| 嘉禾县| 忻城县| 邵阳市| 丹东市| 桦甸市| 孙吴县| 彰武县| 阿坝| 南陵县| 旌德县| 无锡市| 报价| 三穗县| 罗山县| 长春市| 榆中县| 德安县| 镇赉县| 炉霍县| 治县。| 威信县| 中方县| 敦煌市| 双流县| 手游| 天等县| 黄石市| 皋兰县| 房山区| 肥西县|