0

剣道着を使用しています。グリッドを並べ替えると、次のページのデータが並べ替えられません。最初のページでのみソートされます。グリッド内のデータ全体を並べ替えたい。どうすればできますか??

$("#ProductGrid").kendoGrid({
          columns: [
 { field: "ProductID", title: 'Product Id' ,width:50},
 { field: "ProductName", title:  'Product Name' },
 { field: "Price", title: 'Price' },            
 ],
  groupable: true,
  sortable: true,
  pageable: true,
  dataBound: function () {
                this.expandRow(this.tbody.find("tr.k-master-row").first());
            },

  scrollable: true,
  filterable: true,
  dataSource: new kendo.data.DataSource({
  transport: {
       read: "../api/Product/FindByPartyIDForGrid?partyID=" + PartyID

             },
  serverPaging: true,
  serverSorting: true,
  pageSize: 50,
  schema: {
            data: "Data",
            total: "Count"
          }
       })
});

私のサーバー側の方法

[System.Web.Http.AcceptVerbs("GET", "POST")]
[System.Web.Http.HttpGet]
[ActionName("FindByPartyIDForGrid")]
public Responce FindByPartyIDForGrid(string partyID)
{
    int take = httpRequest["take"] == null ? 10 : int.Parse(httpRequest["take"]);
    int skip = httpRequest["skip"] == null ? 0 : int.Parse(httpRequest["skip"]);
       var content = new ProductBS().FindByPartyID(Convert.ToInt32(partyID));
      if (content != null)
      {
       return new Models.Responce(content.Skip(skip).Take(take).ToArray(), content.Count());
      }
      else
      {
       return new Responce(new Array[0], 0);
      }   
}
4

2 に答える 2

1

これはクライアント側 (剣道) の問題ではないようです。私が見ることができるように、剣道グリッドは正しく設定されています。あなたのFindByPartyIDForGridメソッドでは、ソートを行い、関連するページを正しく返す必要があります。

サーバー ロジックを確認してください。ここに投稿していただければ、確認できます。

EDIT サーバーでソートを処理していないようです.2つのオプションがあります.

1.Odata プロトコルを使用して実行
できます。 2.自分で並べ替えを処理することで実行できます。

于 2013-10-01T05:22:27.023 に答える