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

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

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

1.在列屬性中加入事件

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

2.寫一個函數(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.記得這個寫在表格的前面

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

4.點擊“彈出模態(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">關閉</button>

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

總結

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

相關文章

最新評論

南开区| 岐山县| 新津县| 旬阳县| 平遥县| 荥阳市| 南开区| 突泉县| 苗栗市| 格尔木市| 阳朔县| 洪洞县| 汉川市| 洪泽县| 阜康市| 满洲里市| 西充县| 赤城县| 昌宁县| 绥阳县| 农安县| 乐安县| 泽库县| 三门峡市| 正阳县| 白银市| 台中市| 郸城县| 通化市| 丰城市| 定边县| 庆城县| 栖霞市| 惠州市| 拉萨市| 高要市| 吉木萨尔县| 辽中县| 千阳县| 萝北县| 洪江市|