Kendo ui 如何根据项目的状态更改剑道网格中“自动完成”下拉列表(用于添加新行)中项目的文本颜色? @(Html.Kendo().Grid()) .名称(“COOfficerVM”) .HtmlAttributes(新的{style=“height:100%;padding:0px;margin:0px;“}) .列(列=> { columns.Bound(a=>a.OfficerID.Hidden(); columns.Bound(a=>a.FullName).Width(100).Title(“信贷官员”).ClientTemplate(“#=

Kendo ui 如何根据项目的状态更改剑道网格中“自动完成”下拉列表(用于添加新行)中项目的文本颜色? @(Html.Kendo().Grid()) .名称(“COOfficerVM”) .HtmlAttributes(新的{style=“height:100%;padding:0px;margin:0px;“}) .列(列=> { columns.Bound(a=>a.OfficerID.Hidden(); columns.Bound(a=>a.FullName).Width(100).Title(“信贷官员”).ClientTemplate(“#=,kendo-ui,kendo-grid,Kendo Ui,Kendo Grid,getFormat(非活动、非活动官员、全名)#“”; 列.绑定(a=>a.OfficerNumber).宽度(50).标题(“官员编号”); columns.Bound(a=>a.UserID).Width(50).Title(“用户ID”) columns.Bound(a=>a.InActive).标题(“已删除”).宽度(50) .ClientTemplate(“”); columns.Command(commands=> { com

getFormat(非活动、非活动官员、全名)#“”; 列.绑定(a=>a.OfficerNumber).宽度(50).标题(“官员编号”); columns.Bound(a=>a.UserID).Width(50).Title(“用户ID”)

columns.Bound(a=>a.InActive).标题(“已删除”).宽度(50)
.ClientTemplate(“”);
columns.Command(commands=>
{                            
commands.Edit().Text(“编辑”);
命令。自定义(“删除”)。单击(“删除”);
}).宽度(50)。标题(“编辑”);
})
.ToolBar(ToolBar=>
{
toolbar.Create().Text(“添加新”);
})
.Editable(Editable=>Editable.Mode(GridEditMode.InLine))
.Events(e=>e.Edit(“onEdit”))
.Sortable()
.Scrollable()
.DataSource(DataSource=>DataSource
.Ajax()
.Events(Events=>Events
.Error(“错误处理程序”)
)
.Model(Model=>Model.Id(p=>p.OfficerID))
.Create(“\u Insert”,“COOfficer”)
.读作(“\u COOfficerGrid”,“COOfficer”)
.Update(“更新”、“合作伙伴”)
.Destroy(“\u Delete”,“COOfficer”)
)
)

//下拉菜单正在控制器内调用自动完成功能

您可以为自动完成项目设置模板:模板可以包含根据项目属性有条件地输出不同html的代码,例如案例中的“活动”。如果您需要进一步的指导,请编辑您的问题以包含自动完成的html。请注意,自动完成的模板在该链接处标记为“新”功能,因此可能不可用,具体取决于您安装的剑道UI版本。NigelK,我添加了网格代码。这是使用剑道MVC网格…我试图了解引擎盖下发生了什么。如何更改..是否可以捕获K-Autocomplete类并根据Astive或now设置其中所有
  • 的颜色。。?
    How to change the text color of the items in the AUtocomplete drop down ( for add new row) in Kendo Grid based on the status of the item?
    
    I am working on a Kendo Grid. it has an Add new row button when clicked creates a blank row inline to grid. The input field is Autocomplete and data is of tyoe object.Fullname. I need to change the color of the values in this autocomplete dropdown based on the value of Object.Active.
    
    Any suggestions please?
    
    //code here
    
    @(Html.Kendo().Grid<....Models...VM>()
            .Name("COOfficerVM")
                                .HtmlAttributes(new { style = "height: 100%; padding: 0px; margin: 0px; " })
                            .Columns(columns =>
                            {
                                columns.Bound(a => a.OfficerID).Hidden();
                                columns.Bound(a => a.FullName).Width(100).Title("Credit Officer").ClientTemplate("#=
    
                                columns.Bound(a => a.InActive).Title("Deleted").Width(50)
                                    .ClientTemplate("<input type='checkbox' disabled='disabled' value='#= InActive #' " +
                                        "# if (InActive) { #" +
                                            "checked='checked'" +
                                        "# } #" +
                                    "/>");
                                columns.Command(commands =>
                                {                            
                                    commands.Edit().Text("Edit");
                                    commands.Custom("Delete").Click("Delete");
                                }).Width(50).Title("Edit");
                            })
    
                            .ToolBar(toolbar =>
                            {
                                toolbar.Create().Text("Add New");
    
                            })
                .Editable(editable => editable.Mode(GridEditMode.InLine ))
                    .Events(e => e.Edit("onEdit"))
                .Sortable()
                    .Scrollable()
                 .DataSource(dataSource => dataSource        
                    .Ajax()
                        .Events(events => events
                            .Error("error_handler")
                )
    
                    .Model(model => model.Id(p => p.OfficerID))
                        .Create("_Insert", "COOfficer")
                                .Read("_COOfficerGrid", "COOfficer")
                        .Update("_Update", "COOfficer")
                            .Destroy("_Delete", "COOfficer")
            )
                )</div>