当前位置: 动力学知识库 > 问答 > 编程问答 >

kendo ui - What is column syntax for odata linked table

问题描述:

I have a normal WCF service where there is a product that belongs to a department.

The URL to get a department of a given product would look like this:

http://localhost:49168/RapDataService.svc/Products(1000)/Department/Name

Using Razor I can have the foreignkey column that does what I want, but I can't find the syntax for JavaScript. I would assume something like this:

 columns: [

{

field: "Department#Name",

filterable: false

},

But I can't find the correct syntax anywhere.

网友答案:

Found answer, just have to expand the datasource

                type: "odata",
                transport: {
                    read: {
                        url: "http://localhost:49168/RapDataService.svc/Products",
                        data: { $expand: "Department"}
                    }
                },

And then the syntax I was looking for was the dot.

                {
                    field: "Department.Name",
                    title: "Afdeling",
                    filterable: true
                },
分享给朋友:
您可能感兴趣的文章:
随机阅读: