1
我使用敲擊頁面網格,如this example中所示。 library動態創建一個網格表,我想稍微改變它點擊標題的文本後使用排序功能。將排序功能添加到動態創建的網格
而不是
<th data-bind="text: headerText "> </th>
我想看到這一點:
<th>
<a data-bind="click: MyPage.sort, text: headerText" ></a>
</th>
但它不工作。如果我叫click: console.log(MyPage.sort)
它寫道:「不確定」,並click: console.log(MyPage.sort())
後:
Object function MyPage() { // body of function ... self.sort = function(item, event) { console.log('qwerty') ... } ... } has no method 'sort'
有沒有辦法在這個例子中所說的「排序」?或者還有其他的方式(除了改變knockout.simpleGrid.1.3.js)嗎?