0

構造のリストを jTable グリッドにバインドすると、機能します。たとえば、私の構造は次のようになります。

class A {
    public string c1 = "test-c1";
    public string c2 = "test-c2";
}

私のコントローラではList<A>、JSON として jTable の load メソッドに戻ると、正常に動作します。jTable はグリッドを表示しています。

そのためのコードは

return Json(new { Result = "OK", Records = obj of List<A>, TotalRecordCount = studentCount });

以下のように、DataTableに同じものがある場合

C1 C2
Test-c1 Test-C2

ここで、C1 と C2 はデータ列であり、上記のステートメントを使用して dt を返す場合

return Json(new { Result = "OK", Records = dt, TotalRecordCount = studentCount });

理論的には、DataTable も行のリストです。では、なぜこれが機能しないのでしょうか。

4

1 に答える 1