欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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ì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • JavaScript中如何使用cookie實(shí)現(xiàn)記住密碼功能及cookie相關(guān)函數(shù)介紹

    JavaScript中如何使用cookie實(shí)現(xiàn)記住密碼功能及cookie相關(guān)函數(shù)介紹

    cookie是網(wǎng)站設(shè)計(jì)者放置在客戶端(瀏覽器)的小文本文件,cookie不僅能夠?qū)崿F(xiàn)保存密碼功能,還可以通過(guò)cookie保存最近瀏覽記錄增加用戶體驗(yàn)。本文給大家介紹js使用cookie實(shí)現(xiàn)記住密碼功能及cookie相關(guān)函數(shù)講解,感興趣的朋友一起看看吧
    2016-11-11
  • uniapp中安裝axios并解決跨域問(wèn)題小結(jié)

    uniapp中安裝axios并解決跨域問(wèn)題小結(jié)

    跨域(Cross-Origin)是指在瀏覽器中,當(dāng)前網(wǎng)頁(yè)的協(xié)議、域名或端口與請(qǐng)求目標(biāo)的協(xié)議、域名或端口不相同,即存在跨域請(qǐng)求的情況,這篇文章主要介紹了uniapp中安裝axios并解決跨域問(wèn)題小結(jié),需要的朋友可以參考下
    2024-05-05
  • IE8利用自帶的setCapture和releaseCapture解決iframe的拖拽事件方法

    IE8利用自帶的setCapture和releaseCapture解決iframe的拖拽事件方法

    最近有個(gè)需求須要實(shí)現(xiàn)左右拖拽功能,頁(yè)面右邊是個(gè)iframe頁(yè)面,在chrome測(cè)試通過(guò)之后,發(fā)現(xiàn)在ie8上面效果不是很理想,查閱相關(guān)資料找到可以使用ie自帶的setCapture和releaseCapture來(lái)解決,需要的朋友可以參考下
    2016-10-10
  • 詳解在Javascript中進(jìn)行面向切面編程

    詳解在Javascript中進(jìn)行面向切面編程

    這篇文章主要介紹了Javascript面向切面編程,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • javascript中的this作用域詳解

    javascript中的this作用域詳解

    這篇文章主要介紹了javascript中的this作用域詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-07-07
  • javascript實(shí)現(xiàn)二叉樹(shù)的代碼

    javascript實(shí)現(xiàn)二叉樹(shù)的代碼

    本篇文章主要介紹了javascript實(shí)現(xiàn)二叉樹(shù)的代碼,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-06-06
  • JavaScript實(shí)現(xiàn)美化滑塊效果

    JavaScript實(shí)現(xiàn)美化滑塊效果

    這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)美化滑塊效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-05-05
  • 摘自啟點(diǎn)的main.js

    摘自啟點(diǎn)的main.js

    來(lái)自啟點(diǎn)的js,主要包括字符串的trim,cookies設(shè)置等
    2008-04-04
  • 解決layui追加或者動(dòng)態(tài)修改的表單元素“沒(méi)效果”的問(wèn)題

    解決layui追加或者動(dòng)態(tài)修改的表單元素“沒(méi)效果”的問(wèn)題

    今天小編就為大家分享一篇解決layui追加或者動(dòng)態(tài)修改的表單元素“沒(méi)效果”的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-09-09
  • Bootstrap 粘頁(yè)腳效果

    Bootstrap 粘頁(yè)腳效果

    Bootstrap 粘頁(yè)腳,說(shuō)得具體一點(diǎn)就是“將固定高度的頁(yè)腳緊貼頁(yè)面底部”,本文給大家分享具有實(shí)現(xiàn)代碼,感興趣的朋友參考下吧
    2016-03-03

最新評(píng)論