2017-05-22 7 views
0

ページング機能を有効にしたデータを表示する剣道グリッドがあります。ナビゲーションボタンをクリックすると剣道グリッドのデータが消えます

ページ番号ボタンをクリックするとデータが表示されますが、ナビゲーションボタン(次、前、最初、最後)をクリックすると、グリッドは空きレコードなしのメッセージになります。

以下のスニペットは、私のグリッドコードです:resizeGrid機能について

function BindTranscript(ObjectData) { 
      $("#grid").kendoGrid({ 
       noRecords: true, 
       dataSource: { 
        data: ObjectData, 
        pageSize: 20, 
        schema: { 
         model: { 
          fields: { 
           Heading: { type: "string", editable: false, nullable: true }, 
           date: { type: "string", editable: false, nullable: true }, 
           person: { type: "string", editable: false, nullable: true }, 
           Visitor: { type: "string", editable: false, nullable: true }, 
           Category: { type: "string", editable: false, nullable: true }, 
           details: { type: "string", editable: false, nullable: true } 
          } 
         } 
        }, 
       }, 
       // height: 550, 
       // groupable: true, 
       sortable: true, 
       pageable: true, 
       dataBound: resizeGrid, 
       scrollable: true, 
       sortable: true, 
       columns: [{ 
        template: "<div class='icon'>" + 
        "<span class='k-icon k-i-data'></span></div> #: heading #", 
        field: "heading", 
        title: "heading", 
        width: 240 
       }, { 
        field: "date", 
        title: "Date" 
       }, 
       { 
        field: "person", 
        title: "person" 
       }, 
       { 
        field: "Visitor", 
        title: "Visitor" 
       }, 
       { 
        template: "<div class='category other'>" + 
        "<div class='cat-name'>#: Category #</div></div>", 
        field: "Category", 
        title: "Category" 
       }, 
       { 
        field: "details", 
        title: "details" 
       }], 
      }); 
     } 

Object

Data Grid With Page Numbers

コードスニペット:

function resizeGrid() { 
      var gridElement = $("#datagrid"), 
       dataArea = gridElement.find(".k-grid-content"), 
       gridHeight = gridElement.innerHeight(), 
       otherElements = gridElement.children().not(".k-grid-content"), 
       otherElementsHeight = 0; 
      otherElements.each(function() { 
       otherElementsHeight += $(this).outerHeight(); 
      }); 
      dataArea.height(gridHeight - otherElementsHeight); 
     } 
+0

コンソールウィンドウにエラーがありますか? – Sandman

+0

いいえ、エラーがないので、私はスタックオーバーフローでこれをポストしなければなりませんでした。グリッドには、ナビゲーションボタン以外のすべてが完璧に(ページ番号ボタンまで)完全に細かく設定されています。 – IntelligentCancer

+0

問題を再現するための印刷画面または実行可能な例(Dojo)がありますか? – Sandman

答えて

0

あなたはあなたのschema.model.fieldsとを定義していますfields(質問に添付された単一のオブジェクト例に基づいて)間違っています。

$("#grid").kendoGrid({ 
      noRecords: true, 
      dataSource: { 
       data: ObjectData, 
       pageSize: 10, 
       schema: { 
        model: { 
         fields: { 
          //Heading: { type: "string", editable: false, nullable: true }, 
          date: { type: "string", editable: false, nullable: true }, 
          Agent: { type: "string", editable: false, nullable: true }, 
          Visitor: { type: "string", editable: false, nullable: true }, 
          Category: { type: "string", editable: false, nullable: true }, 
          Notes: { type: "string", editable: false, nullable: true } 
         } 
        } 
       }, 
      }, 
      // height: 550, 
      // groupable: true, 
      sortable: true, 
      pageable: true,     
      scrollable: true, 
      sortable: true, 
      columns: [{ 
       field: "date", 
       title: "Date" 
      }, 
      { 
       field: "Agent", 
       title: "person" 
      }, 
      { 
       field: "Visitor", 
       title: "Visitor" 
      }, 
      { 
       template: "<div class='category other'>" + 
       "<div class='cat-name'>#: Category #</div></div>", 
       field: "Category", 
       title: "Category" 
      }, 
      { 
       field: "details", 
       title: "details" 
      }], 
     }); 

注:

定義は次のようにする必要があり、私はそれが(もしあれば)に属する財産分からないように私はHeadingを削除しました。

小文字でも小文字でDojo exampleをノックしています。お役に立てれば。

+0

こんにちは私は私が問題を引き起こしていたそれを再バインドする前にグリッドを破壊する必要があることを知って助けてくれてありがとう – IntelligentCancer

関連する問題