【问题标题】:jQuery Bootgrid replace tr no-results before charge content ajaxjQuery Bootgrid在收费内容ajax之前替换tr no-results
【发布时间】:2017-07-29 07:24:24
【问题描述】:

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

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

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

【问题讨论】:

    标签: javascript php jquery jquery-bootgrid


    【解决方案1】:

    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我创建的。尝试搜索会导致“no results found”的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-05-22
      • 2014-11-01
      • 2016-10-27
      • 1970-01-01
      • 1970-01-01
      • 2011-01-07
      • 2011-01-30
      相关资源
      最近更新 更多