0

我有一个 KENDO UI GRID 控件,并且 JSON 中的数据显示正确。在那个 JSON 中,我在主 JSON 对象中有一个对象。无论如何要在列中显示该字段。这是我根据其他地方网络上的一些链接尝试过的,但它没有用。这些值也正确显示在控制台中。我应该怎么做?我想在一列中显示 ID.Value 并且 ID 是一个对象。

 var eventsDataSource = new kendo.data.DataSource({
                            data: events,
                            batch: true,
                            schema: {
                                model: {
                                    fields: {
                                        ID.Value : {type:"string"},
                                        CardNumber: { type: "string" },
                                        Description: { type: "string" },
                                        Origin: { type: "Date" },
                                        Priority:{type:"int"},
                                        ReaderName: { type: "string" },
                                        More: { title: "Image"}
                                    },

                                }
                            },
                            pageSize: 8
                        });
                        $("#eventsgrid").kendoGrid(
                            {
                                dataSource: eventsDataSource,
                            navigatable: true,
                            pageable:
                                {
                                input: true,
                                numeric: false
                                },
                                sortable:true,
                            columns: [
                                {
                                    field: "ID.Value",style:"display:none"
                                },
                            {
                                field:"",width:"30px", template:'<input type="checkbox" id="selectevent"/>'
                            },
                            {
                                field:"CardNumber",width:"80px"
                            },
                            {
                                field: "Image", width: "45px", title: "Type", template: "<img src='/Content/Themes/Default/images/AlarmType.png' id='AlarmType'/>"
                            },
                            {
                                field: "Priority", width: "60px", title: "Priroty"
                            },
                            {
                                field: "Origin", title:"Event Time"
                            },
                            {
                                field:"Description", title:"Alarm Title"
                            },
                            {
                                field: "ReaderName", title: "Location"
                            },
                            {
                                field: "", title: "Actions and Interactions", width: "160px", template: '<input type="button" data-id=ID value="Acknowledge" onclick="javascript:CheckAck(this);" id="Acknowledge" /><br/><a href="javascript:performActions()"  >3 Actions</a>'
                            },
                            {
                                field: "Image", title: "More", width: "60px", template: "<img src='/Content/Themes/Default/images/Door.png' onclick='showDetails()' id='door' width='20' height='20'/><div id='cardholderdetails'></div>"
                            }

                            ],

                        }).data("kendoGrid");
4

0 回答 0