尝试使用Kendo ComboBox HtmlHelper通过nodatatemplate添加新记录。有没有办法可以做到这一点。如果不是,我们如何添加一个按钮来提示添加新记录
@(Html.Kendo().ComboBox()
.Name("shipAddress")
.MinLength(3)
.Filter(FilterType.Contains)
.Placeholder("Start Typing a Address")
.Template(" #= Address #, #= City #, #= RegionAbbreviation #, #= PostalCode #")
// .Template("#= Address #, #= City #, #= RegionAbbreviation #, #= PostalCode #")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCustomerAddresses", "Ship")
.Data("onAdditionalData");
})
.ServerFiltering(true);
})
.DataTextField("Address")
.DataValueField("Customer")
.HtmlAttributes(new { @class = "form-control shadow-input", tabindex = "2" })
.Events(e =>
{
e.Select("autocompleteSelect").Open("autocompleteOpen").Close("autocompleteClose").Filtering("onFilter").DataBound("onDataBound").Change("onChange");
})
.NoDataTemplate("未找到数据。是否要添加新项目") .Deferred())
非常感谢 杰