我有问题,在bootgrid重装阿贾克斯数据(http://www.jquery-bootgrid.com/)刷新jQuery中BootGrid不行
我已经成功准备网格以显示在所有的,但如果我添加项目到DB,我想使电网的重载。
我的代码是现在这个(缩短):
var grid;
$(document).ready(function() {
grid = initGrid();
});
function initGrid() {
var local_grid = $('#clients-grid').bootgrid({
"ajax": true,
"url": "/client/grid",
"formatters": {
"commands": function(column, row) {
return "<button type=\"button\" class=\"btn btn-default command-edit\" data-row-id=\"" + row.id + "\"><span class=\"glyphicon glyphicon-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-default command-delete\" data-row-id=\"" + row.id + "\"><span class=\"glyphicon glyphicon-trash\"></span></button> " +
"<button type=\"button\" class=\"btn btn-default command-mail\" data-row-id=\"" + row.id + "\"><span class=\"glyphicon glyphicon-envelope\"></span></button>";
},
"tooltips": function(column,row) {
return '<span type="button" class="content-popover" title="'+row.name+'" data-content="'+row.content+'">Najeďte myší pro zobrazení obsahu</span>';
},
"clientname": function(column,row) {
return row.name;
}
}
}).on("loaded.rs.jquery.bootgrid", function() {
$('.content-popover').popover({
trigger: 'hover',
html: true,
placement: 'right',
content: $(this).attr('data-content')
});
grid.find(".command-edit").on("click", function(e) {
editClient($(this).data('row-id'));
}).end().find(".command-delete").on("click", function(e) {
var id = $(this).data('row-id');
if (confirm('Opravdu smazat klienta s ID: '+$(this).data("row-id")+'?')) {
deleteClient($(this).data('row-id'));
}
}).end().find(".command-mail").on("click", function(e){
mailClient($(this).data('row-id'));
});
});
return local_grid;
}
所以对电网的变量是全球和地方有访问.. 但功能重装这里记载:http://www.jquery-bootgrid.com/Documentation#methods没有工作,我有阿贾克斯的参数集on true
有什么建议吗?
谢谢,对不起,我的英语
谢谢迈克尔。你是一个拯救生命的人。为我省了很多搜索力:) – 2015-07-21 09:20:28
页面没有保留。 – arhuaco 2015-10-05 15:02:15