Javascript 如何在jquery bootgrid基本插件中使用href

Javascript 如何在jquery bootgrid基本插件中使用href,javascript,php,jquery,jquery-bootgrid,Javascript,Php,Jquery,Jquery Bootgrid,我使用bootgrid basic显示我的数据 <table id="grid-basic" class="table table-bordered table-striped table-condensed mb-none"> <thead> <th data-column-id="aa">aa</th> <th data-column-id="ss" data-order="desc"&g

我使用bootgrid basic显示我的数据

<table id="grid-basic"
    class="table table-bordered table-striped table-condensed mb-none">
    <thead>
        <th data-column-id="aa">aa</th>
        <th data-column-id="ss"  data-order="desc">ss</th>
        <th data-column-id="dd">dd</th>
        <th data-column-id="ff">ff</th>
        <th data-column-id="aaa">aaa</th>
        <th data-column-id="aaaaa" >aaaAa</th>

        </tr>
    </thead>
    <tbody>
        @foreach($alldata as $data)
        <tr>
            <td>{{$data->aa}}</td>
            <td><a href="#">{{$data->ss}}</a></td>
            <td>0</td>
            <td>{{$data->dd}}</td>
            <td>{{$data->ff}}</td>
            <td><a href="#">ASSSsdf</a></td>
        </tr>
        @endforeach
    </tbody>
</table>

这里有一个JSIDLE链接:

您的JS中缺少一个括号,它应该是
bootgrid({
),您需要将
data formatter=“link”
添加到您希望使用格式化程序的列(即链接列)的
th
标记中

HTML

 <th data-column-id="link" data-formatter="link" >Received</th>
已收到
JQuery

$(function()
{
  $("#grid-basic").bootgrid({

    formatters: {
        "link": function(column, row)
        {
            return "<a href=\"" + row.link + "\">" + row.link + "</a>";
        }
    }
  }
  )
});
$(函数()
{
$(“#网格基本”).bootgrid({
格式化程序:{
“链接”:功能(列、行)
{
返回“”;
}
}
}
)
});

请注意,下次尝试使用内置代码段,因为有一个一键按钮,可以让您将代码复制到答案部分并进行相应修改。

如果您看到我共享的fiidle,则会有一个搜索框,即每页记录数功能。但您的fiddle没有显示这一点。我以前尝试过这一点。
$(function()
{
  $("#grid-basic").bootgrid({

    formatters: {
        "link": function(column, row)
        {
            return "<a href=\"" + row.link + "\">" + row.link + "</a>";
        }
    }
  }
  )
});