日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

html表格右键可编辑,Bootstrap table右键功能实现方法

發布時間:2023/12/15 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html表格右键可编辑,Bootstrap table右键功能实现方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近遇到有一個需求,需要在Bootstrap table上使用右鍵。網上搜了半天沒有找到,最后發現Bootstrap table不支持右鍵(官方文檔給出的答案 https://github.com/wenzhixin/bootstrap-table/issues/241 )。

本文介紹使用contextMenu插件實現Bootstrap table右鍵功能。

代碼(test.html):

$('#item_table').bootstrapTable({

columns: [{

field: 'id',

title: 'Item ID'

}, {

field: 'name',

title: 'Item Name'

}, {

field: 'price',

title: 'Item Price'

}],

data: [{

id: 1,

name: 'Item 1',

price: '$1'

}, {

id: 2,

name: 'Item 2',

price: '$2'

}]

});

$.contextMenu({

// define which elements trigger this menu

selector: "#item_table td",

// define the elements of the menu

items: {

foo: {name: "Foo", callback: function(key, opt){ alert("Foo!"); }},

bar: {name: "Bar", callback: function(key, opt){ alert("Bar!") }}

}

// there's more, have a look at the demos and docs...

});

效果圖:

關于contextMenu的使用,可以參考網頁中右鍵功能的實現— contextMenu的使用 。

關于Bootstrap table的使用,可以參考官方文檔Bootstrap table。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持。

總結

以上是生活随笔為你收集整理的html表格右键可编辑,Bootstrap table右键功能实现方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。