javascript - jQuery Bootgrid 替换 tr no-results before charge content ajax

标签 javascript php jquery jquery-bootgrid

我创建了一个与 ajax 内容连接的 jQuery Bootgrid 表,在加载 ajax 内容时,它显示“找不到结果!”

<td colspan="4" class="no-results">No results found!</td>

如何更改 td 内容,并在内容加载时放置图像?

最佳答案

Bootgrid 提供了一个labels 选项,您可以使用它来覆盖一些文本。其中之一正是您想要的:

var grid = $("#grid-data").bootgrid({
    ajax: true,
    url: "/api/data/basic",
    labels: {
        noResults: '<img src="http://www.example.com/not-found.png" />'
    }
});

their documentation您可以检查可以覆盖哪些其他标签。在您的情况下,我没有替换为其他文本,而是替换为 img html 标记。

this JSFiddle我创建。尝试搜索会导致“找不到结果”的内容。

关于javascript - jQuery Bootgrid 替换 tr no-results before charge content ajax,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42676207/

相关文章:

javascript - 第一个 jquery 事件正在发生,但不是第二个

javascript - 无法从 .json 文件加载 json 数据

php - 无法使用 PHP 进行 AJAX post 工作

php - 将 Azure 上的 Redis 与 Symfony2 结合使用

php - 打字3 6.2 : "Could not find a suitable type converter for "String""exeption after update

javascript - 如何使用 RequireJS 实现工厂设计模式?

javascript - 如何从给定的 DOM 对象获取完整的 css 选择器字符串

PHP Include 不显示页眉和页脚

javascript - 滑入动画不起作用

javascript - 使用 Gulp uglify 和 Concat 添加自定义新行