即時嘗試使用KendoUI網格作爲我的一個項目。我想要綁定到網格的數據源有很多額外的部分,我不想將其作爲列加上其他幾個選項。我想知道是否有一種方法可以從javascript設置網格的選項,但是當我嘗試時,我似乎遇到了「數據」選項的問題。KendoUI網格分配選項
<div data-bind="kendoGrid: $parent.kendoGrid"></div>
....
program = ko.observable(null),
kendoGrid = { data: program.BettingInterest, sortable: true, columnMenu: true,
columns: [{ field: 'BettingInterestProgramNumber', title: 'Post' },
{ field: 'PostPosition', title: 'PP' }, { field: 'MLOdd', title: 'ML' },
{ field: 'FractionalOdd', title: 'Odds' }, 'Jockey', 'Trainer', 'Owner',
{ field: 'WeightCarried', title: 'Weight' }, { field: 'Medication', title: 'Med' },
{ field: 'ClaimingPrice', title: 'Claiming' }, 'Breed'],
scrollable: false, resizable: true
},
....
「節目」被一系列級聯下拉菜單 我格在最後充滿顯示了與列等,但沒有實際的數據。我想知道如果我只是缺少一些簡單的...
你能告訴program'如何得到'填補?我不知道如果你可以綁定網格到'program.BettingInterest',當那個屬性不存在於'program'可觀察的時候。另外,在填充'program'之後,您可能想要嘗試在網格上調用'.refresh()'。 http://docs.kendoui.com/api/web/grid#refresh – CodingWithSpike