2016-06-11 6 views
2

私は剣道のことを少し知っていますので、私はあなたの助けを求めています。 xmlデータを使って剣道グリッドを表示しようとしています。ただし、グリッドの行は空白で表示されます.i URL(http://demos.kendoui.com/service/Northwind.svc/Products)からデータを取得し、剣道ウィジェットにデータソースを設定しようとしています。一度サンプルを実行すると、 (http://jsfiddle.net/visibleinvisibly/c3qsdjq0/19/)、空のグリッドが表示されます。私はこれは私がこのサンプル以下剣道UIグリッドウィジェットXMLデータソースコンテンツが表示されない

のためのJSONを使用したいwouldntのdatasource.Iの「スキーマ」オブジェクトで「データ」プロパティを設定することはできませんよと何が起こっていると信じては、サンプルXMLデータ

<feed xml:base="http://demos.telerik.com/kendo-ui/service/Northwind.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> 
    ............................. 
    ........................... 
    <entry> 
    .................. 
    .................... 
    <content type="application/xml"> 
     <m:properties> 
     <d:ProductID m:type="Edm.Int32">1</d:ProductID> 
     <d:ProductName>Chai</d:ProductName> 
     <d:UnitPrice m:type="Edm.Decimal">18.00</d:UnitPrice>  
     </m:properties> 
    </content> 
    </entry> 
    </feed> 
です

スキーマ内のデータプロパティは、事前にこの

schema: { 
type: "xml", 
data: "/feed/entry/content/properties", 
model: { 
     fields: { 
      ProductID: "ProductID/text()", 
      ProductName: "ProductName/text()", 
      UnitPrice: "UnitPrice/text()" 
     } 
    } 
} 

おかげで、

アレックスのように設定されています。

答えて

0

@Alex - 以下は、私の分析である -

ポイント1号 -

私はクロームであなたのjsfiddleサンプル(http://jsfiddle.net/visibleinvisibly/c3qsdjq0/19/)を実行しようとすると、私はコンソールでエラーの下に取得し表示されていないデータ -

"XMLHttpRequest cannot load http://demos.kendoui.com/service/Northwind.svc/Products?take=10&skip=0&page=1&pageSize=10. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access." 

enter image description here

は、これは明らかに、なぜ協力を示し、あなたの剣道のUIグリッドには表示されません。

ポイント2号 - 私はAngularJSを使用してXML型を使用しようと、私は信じているエラー -

"Unknown DataSource transport type 'xml'. 
Verify that registration scripts for this type are included after Kendo UI on the page." 

enter image description here

下になった、これは彼らがあることを意味XML

を使用してデータソーストランスポートタイプとしてのXMLは使用できません。 JSONまたはODaataに依存する必要があります。

願っています。

乾杯 サンケン

関連する問題