gpt4 book ai didi

javascript - 如何为 jquery-bootgrid 设置工具提示

转载 作者:行者123 更新时间:2023-11-30 08:38:06 27 4
gpt4 key购买 nike

这是我第一次实现 jquery-bootgrid。我已经使用以下代码成功实现了它。但问题是,

(1) 我无法为表头分配工具提示。

(2)如何给每列分配宽度?

感谢您的建议。

<table id="grid-basic" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th id="umrn" data-column-id="umrn" data-sortable="true" title="UMRN Number" data-toggle="tooltip" data-placement="top" title="Tooltip on top">UMRN</th>
<th data-column-id="mandate_status" data-sortable="true" title="Mandate Status">Status</th>
<th data-column-id="mandate_date" data-sortable="true">Date</th>
<th data-column-id="payment_type" data-sortable="true">Payment type</th>
<!-- <th data-column-id="currency" data-sortable="true"> Currency</th> -->
<th data-column-id="fixed_amount" data-sortable="true"> Fixed amount</th>
<th data-column-id="max_amount" data-sortable="true"> Max amount</th>
<!-- <th data-column-id="debtor_bank" data-sortable="true"> Debtor bank</th> -->
<th data-column-id="creditor_bank" data-sortable="true"> Creditor bank</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">Options</th>
</tr>
</thead>
</table>
<script type="text/javascript">
var _globalObj = {{ json_encode(array('_token'=> csrf_token())) }}
</script>

<script type="text/javascript">
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('#example').tooltip(options)
})
var token = _globalObj._token;
var grid = $("#grid-basic").bootgrid({
caseSensitive:false,
ajax: true,
post: function ()
{
return {
id: "b0df282a-0d67-40e5-8558-c9e93b7befed",_token:token
};
},
url: 'getAllMandates',
formatters: {
"commands": function(column, row)
{
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " ;
}
}
}).on("loaded.rs.jquery.bootgrid", function()
{

/* Executes after data is loaded and rendered */
grid.find(".command-edit").on("click", function(e)
{
//alert("You pressed edit on row: " + $(this).data("row-id"));
location.assign("mandate/"+$(this).data("row-id"));
}).end().find(".command-delete").on("click", function(e)
{
// alert("You pressed delete on row: " + $(this).data("row-id"));
/*
var recID = $(this).data("row-id");
$.ajax({
url: "delete_user",
data : {'rec_id' : recID},
}).done(function( msg )
{
loginDeleteSuccess(msg);
}) */
});
});

最佳答案

你必须在中添加工具提示初始化命令

).on("loaded.rs.jquery.bootgrid", function()
{
$('[data-toggle="tooltip"]').tooltip();
}

它对我有用。

关于javascript - 如何为 jquery-bootgrid 设置工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29643510/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com