-2

JSON 応答:

{
    "current": 1,
    "rowCount": 10,
    "rows": [
        {
            "id": 19,
            "sender": "123@test.de",
            "received":"[
        {
            "name":"received1"
        }
    ]
        }
    ]
},
{
    "id": 14,
    "sender": "123@test.de",
    "received":  [
        {
            "name":"received2"
        }
    ]
},
    ...],
"total": 1123}

ブートグリッドを使用して受信した名前を出力したい。

例:

<th data-column-id="id" data-identifier="true">Id</th>
<th data-column-id="received.name">Name</th>

印刷できますが、印刷received.nameできませんid

4

2 に答える 2

0
{
    "current": 1,
    "rowCount": 10,
"total": 123
    "rows": [
        {
            "id": 19,
            "sender": "123@test.de",
            "received":"received1"
        },
{
            "id": 20,
            "sender": "123@testasdasd.de",
            "received":"receisaddved1"
        }
]
}

// これがグリッドにデータを入力する方法です。

于 2016-02-16T05:06:41.280 に答える
-1

上記の問題については、ブートストラップ ブートグリッドでデータ フォーマッターを使用する必要があります。

ここにコードを添付しました。役立つことを願っています。

<script>  $("#MyTable").bootgrid({
            ajax: true,formatters: {
                "link": function (column, row) 
                {
                    return "<span>" + row.received.name+ "</span>";
                }
            }}); 
</script>

あなたのHtmlは好きです

 <table>
 <th data-column-id="received.name" data-formatter="link">Anything</th> 
 </table>
于 2015-07-28T11:09:45.940 に答える