2013-04-18 74 views
6

在我的項目中,網格和圖表具有相同的數據源,但需要在頁面加載時顯示圖表上的所有數據,並在按鈕單擊中顯示網格數據。在不使用SharedDateSource的情況下在圖表中應用網格更改?

但之前我們使用共享數據源,因此可以輕鬆地應用圖表中的網格更改。 現在對網格和圖表使用單獨的變量,並將"AutoBind=true"用於圖表,"AutoBind=false"兩者都不起作用,並且網格更改必須應用於圖表。

如何爲網格和圖表提供關係?

Here is the fiddle

var sharedDataSource = new kendo.data.DataSource({ 
    type: "odata", 
    transport: { 
     read: "http://demos.kendoui.com/service/Northwind.svc/Orders" 
    }, 
    schema: { 
     model: { 
      fields: { 
      OrderDate: { type: "date" } 
      } 
     } 
    } 
}); 
var DataSource = new kendo.data.DataSource({ 
    type: "odata", 
    transport: { 
     read: "http://demos.kendoui.com/service/Northwind.svc/Orders" 
    }, 
    schema : { 
     model: { 
      fields: { 
       OrderDate: { type: "date" } 
      } 
     } 
    } 
}); 
+0

任何一個可以幫助我這個解決方案 – user123 2013-04-22 09:10:36

+0

好的,謝謝你跳跳雅,我可以張貼現在 – user123 2013-07-29 08:05:17

+0

意味着要使用另一個帳戶您告訴我做upvotes? – user123 2013-07-29 08:20:52

回答

0

使用共享數據源是正確的做法。這裏是固定代碼的小提琴符合您的要求:http://jsfiddle.net/vojtiik/kappG/2/。 autoBind屬性期望布爾值不是字符串(例如:true不是「true」)。

autoBind: true, 
相關問題