网格中有一个剑道数字框.只允许数字.没有小数位和没有逗号分隔符.我以不同的方式尝试但没有成功.不知道......请帮帮我......
在我给出的数据源字段中
seq_no : {type: "number",validation: {min: 1,max: 32767}}
Run Code Online (Sandbox Code Playgroud)
在网格栏中
{ field: "seq_no", width: "50px", title: "Sequence Number", type:"number"}
Run Code Online (Sandbox Code Playgroud) 我有以下场景:
在我的页面中,我有一个网格(带分页)绑定到数据源.当我点击"Extract"按钮时,网格会被填充(通过Web服务读取分页数据).然后我通过网格分页选择"第2页".再次调用Web服务以返回数据.
现在:我想再次点击"Extract",重新加载并在第一页上显示数据.我不确定哪种方式最好.
我想只调用一次服务(带输入参数),并在网格中重置分页索引.
我现在使用以下代码:
$("#btnExtract").bind("click", function(e) {
var grid = $("#section-table").data("kendoGrid");
grid.dataSource.read( {parameter: "value"} );
grid.dataSource.page(1);
});
Run Code Online (Sandbox Code Playgroud)
但实际上它会对服务进行两次调用.
鉴于这个json?
[
{
"CompanyId":20,
"CompanyName":"Walmart",
"CompanyContacts":[
{
"CompanyId":20,
"FirstName":"Bob",
"LastName":"Green",
"Email":"bob@test.com",
"Phone":"1234567",
"IsActive":false
}
]
}
]
Run Code Online (Sandbox Code Playgroud) 我有一个像我这样创建的kendo Grid:
function drawInvoiceTable() {
invoiceTable = $('#invoiceGrid').kendoGrid({
sortable: true,
pageable: true,
dataSource: {
data: getData(),
pageSize: 10,
schema: {
model: {
id: 'test',
fields: {
active: false
}
}
}
},
columns: [
{ template: "<input type='checkbox' id='chkInvoices' class='invoiceDisplay' name='chkInvoices' #= active ? checked='checked' : '' #/>", width: 30 },
{ field: 'accountNumber', title: 'Account', attributes: { 'class': 'accountnumber' }, sortable: true },
{ field: 'transactionDate', title: 'Trans Date', attributes: { 'class': 'transdate' }, width: 100, sortable: true }, …Run Code Online (Sandbox Code Playgroud) 我需要在我的kendo网格列模板中应用一个条件.
这是我的代码:
columns: [
{
field: "EmpName",
title: "Name",
template: '<a href="\\#" onclick="showName();">#= if (empName == null){ "show xxx"
} else {
// I want to show actual name if it is not null
empName
} #</a>'
},
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个Telerik网格视图,但是当我去参考kendo时它无法识别它.当我尝试引用kendo时,Visual Studio给出了一个错误.这是代码@(Html.Kendo().Grid),下面是错误.
'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
我在BundleConfig文件中为Scripts和Content添加了一个包.此外,我已经添加@Scripts.Render("~/bundles/kendo")并@Styles.Render("/Content/kendo")直接向Razor视图.
我读过的很多文章都表明添加<add namespace="Kendo.Mvc.UI"/>到Web.Config文件会起作用,但它仍然会抛出相同的错误.
有什么东西我错过了吗?
我的页面中有一个kendo ui网格,有一些列.现在我想添加一个列,显示行号.我该怎么做?谢谢.
我在尝试使用KendoUI网格为Visual Studio 2013中开发的ASP.NET MVC(.net 4.5)应用程序时遇到异常.我已将网格配置为使用InLine编辑并已明确将Batch设置为false数据源部分.这是作为局部视图呈现的.应该注意的是,如果GridEditMode.InLine设置为GridEditMode.InCell,则不会抛出异常.
您必须使用InCell编辑模式进行批量更新.
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:System.NotSupportedException:必须使用InCell编辑模式进行批量更新.
@using Kendo.Mvc.UI
@model MyApp1.Data.DataModels.Agent
@(Html.Kendo().Grid<MyApp1.Data.ViewModels.PhoneNumberVM>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.Number);
columns.Bound(p => p.Description);
columns.Command(command => command.Edit()).Width(90);
columns.Command(command => command.Destroy()).Width(90);
})
.ToolBar(toolBar =>
{
toolBar.Create().Text("Add Phone Number");
toolBar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(false)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.PhoneNumberId);
model.Field(p => p.PerId).Editable(false).DefaultValue(@Model.PerId);
})
.Read(read => read.Action("_GetPhones", "Pers", new { AgentId = Model.AgentId }))
.Create(create => create.Action("_AddPhone", "Pers"))
.Update(update => update.Action("_EditPhone", …Run Code Online (Sandbox Code Playgroud) 我想将数据从Kendo Grid发布到服务器,并将其保存到数据库中.
为此,我使用了这样的形式:
@using (Html.BeginForm("MainDocumentSave","Document"))
{
<div class="row-fluid">
<div class="span10">
@(Html.Kendo().Grid<Invoice.Models.ViewModels.SegmentViewModel>()
.Name("Segment")
.TableHtmlAttributes(new { style = "height:20px; " })
.Columns(columns =>
{
columns.Bound(p => p.AirlineShortName).EditorTemplateName("AirlineEditor").Title("Airline").ClientTemplate("#=AirlineName#").Width(5);
columns.Bound(p => p.DepartureDate).Width(9);
columns.Bound(p => p.Arrives).EditorTemplateName("ArrivalLocation").Title("Arrival").ClientTemplate("#=Arrives#").Width(5);
columns.Bound(p => p.ArrivalDate).Width(7);
columns.Bound(p => p.FlightNumber).Width(8);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Navigatable()
.Sortable()
.Scrollable(scr => scr.Height(200))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.AirlineName))
.Create("Editing_Create", "Grid")
.Read("Segment_Read", "Document")
.Update("Editing_Update", "Grid")
.Destroy("Editing_Destroy", "Grid")
)
)
</div>
</div>
<button type="submit" class="btn btn-primary"> Save Segments</button>
} …Run Code Online (Sandbox Code Playgroud) asp.net-mvc asp.net-mvc-3 kendo-ui kendo-grid kendo-asp.net-mvc
我正在使用层次结构网格kendo ui.我想隐藏网格标题.目前,我使用下面的代码,但是,只隐藏标题的文本.
// kendo ui grid
.TableHtmlAttributes(new { @class = "GridNoHeader" })
// css
.GridNoHeader thead.k-grid-header
{
height: 0;
border-bottom-width: 0;
visibility: hidden;
overflow: hidden;
}
Run Code Online (Sandbox Code Playgroud)
如果可以,请分享您的经验.谢谢