我有一个剑道网格,并且启用了多重排序。
代码:
sortable: {
mode: "multiple",
allowUnsort: true
}
Run Code Online (Sandbox Code Playgroud)
因为我正在编写服务器端代码来发送对排序操作的响应。为此,我想知道 Kendo Grid 支持的用于多重排序的最大列数。谢谢。
我正在开发一个带有 javascript 内联可编辑选项的 KendoUI 网格,并且无法使更新按钮触发点击事件并将数据发布到服务器端更新事件。单击更新按钮甚至不会更新客户端上的网格。
希望有人能帮我指出我在这里做错了什么。
这不是重复的,因为我已经厌倦了答案中的 jfiddle 链接并且它也不起作用。 剑道 UI 网格更新功能不会触发
<div id="grid"></div>
@section Scripts{
<script type="text/javascript">
$(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "Home/GetPupilsAsJson",
dataType: 'json'
},
update: {
url: "Home/UpdatePupils",
dataType: 'json',
type: 'POST'
}
},
pageSize: 5,
autoSync: true
});
$('#grid').kendoGrid({
dataSource: dataSource,
editable: "inline",
pageable: true,
columns: [{
field: "Id",
title: "Id",
width: 150,
hidden: true
}, {
field: "Firstname",
title: "Firstname",
width: 150
}, {
field: "Lastname",
title: …Run Code Online (Sandbox Code Playgroud) 我想为某些CatalogProductId禁用DiscountPercentageMRC/NRC/Usage列.请在网格下面找到javascript.任何帮助将不胜感激.
<h2>Kendo Grid bound to ASP.NET MVC action methods</h2>
@* The DIV where the Kendo grid will be initialized *@
<div id="grid"></div>
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
columns: [
{ field: "CompanyId"},
{ field: "CompanyName" },
{ field: "DiscountPercentageMRC" },
{ field: "CatalogProductId"},
{ field: "DiscountPercentageMRC" },
{ field: "DiscountPercentageNRC" },
{ field: "DiscountPercentageNRC" },
{ field: "DiscountPercentageUsage"}
],
height: 400,
editable: true, // enable editing
pageable: true,
sortable: true,
filterable: true,
toolbar: ["create", "save", "cancel","edit"], // specify toolbar commands …Run Code Online (Sandbox Code Playgroud) 我可以通过以下模板方案将kendo下拉列表添加到kendo网格中:
<script type="text/x-kendo-template" id="ddlGrid">
<input data-role="dropdownlist"
data-text-field="Text"
data-value-field="Value"
data-bind="source: actionSource, events: { change: onChange}"/>
</script>
<div class="demo-section">
<div class="k-content" style="width: 100%">
<div id="grid"
data-role="grid"
data-sortable="true"
data-selectable="true"
data-columns="[
{ field: 'ProductID' },
{ field: 'ProductName' },
{ field: 'UnitPrice' },
{ field: 'UnitsInStock' },
{ field: 'Discontinued' },
{ title: 'Action', template: kendo.template($('#ddlGrid').html())} ]"
data-bind="source: dataSource, event">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,问题是如何访问该下拉列表以获取值/文本/索引.到目前为止,我可以使用这种方法获取选定的行数据:
var onClick = function (event, delegate) {
event.preventDefault();
var grid = $("#grid").data("kendoGrid");
var selectedRow = grid.select();
var dataItem = grid.dataItem(selectedRow);
if …Run Code Online (Sandbox Code Playgroud) 为什么不在编辑字段的编辑器模板上向我显示网格验证?我不明白为什么不阅读数据注释。抱歉英语不好...
起初我像这样创建了剑道网格:
<div id="grid">
@(Html.Kendo().Grid<CardView>()
.Name("Grid")
.Columns(x =>
{
x.Bound(c => c.CardID).Title("Card Nm.");
x.Bound(c => c.ExpirationDate).Format("{0:dd/MM/yyyy}");//.EditorTemplateName("KendoDatePicker");
x.Command(cmd =>
{
cmd.Edit();
}).Title("Edit");
})
.BindTo(Model)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(x => x.CardID);
})
.ServerOperation(true)
.Read(read => read.Action("Index", "Home"))
.Events(events => events.Error("error_handler"))
.Update(update => update.Action("Update", "Home"))
.Editable(editable =>editable.Mode(GridEditMode.InLine)))
</div>
Run Code Online (Sandbox Code Playgroud)
这是在数据源事件错误中使用的 javascript:
<script>
function error_handler(e, status) {//Klaidu isvedimas
if (e.errors) {
var message = "Error:\n";
var grid = $('#GrdKendo').data('kendoGrid');
var gridElement = grid.editable.element;
var validationMessageTemplate = kendo.template(
"<div id='#=field#_validationMessage' " + …Run Code Online (Sandbox Code Playgroud) 我使用kendo网格插件来显示数据.使用内置功能导出优于kendo网格,导出网格数据. http://demos.telerik.com/kendo-ui/grid/excel-export 但我想在将数据导出到excel之前删除2列.
请让我知道如何实现它
谢谢,努普尔
我有一个日期转换函数,它接受一个datetime参数并返回string. 如何使用此函数格式化DateKendo Grid 中的列?
我已经尝试了以下代码,但没有一个起作用
columns.Bound(x => x.ModifyDate).ClientTemplate(@Utility.GetPersianDate((DateTime)"#: ModifyDate #"));
columns.Bound(x => x.ModifyDate).Template(@<text>@Utility.GetPersianDate((DateTime)@item.ModifyDate)</text>);
columns.Bound(x => x.ModifyDate).Format(@Utility.GetPersianDate(Convert.ToDateTime("#: ModifyDate")));
Run Code Online (Sandbox Code Playgroud)
我也尝试在服务器端转换它,但这是不可能的,因为格式化的日期未被识别为有效日期。这并不重要,因为它只是为了展示。用户不应更改或输入该日期。如果没有任何效果,我可能会考虑在服务器上使用string而不是DateTime转换它。
我有一个问题,我找不到解决办法。
我有具有不同行高的 KendoUI 网格 - 就像在这个例子中 http://jsfiddle.net/Sbb5Z/2/
我尝试在专栏中使用特殊课程,但没有任何帮助
{
attributes: {
"class": "paddingTopZero"
},
}
Run Code Online (Sandbox Code Playgroud)
其中第 3 行比其他行大(第 4 列中的 2 行)。
我想实现,该行中的数据将具有相同的顶部偏移量 - 因此该行中的 1., 2., 3. 5. 和第 6 列不会位于该行的中间,而是位于同一行line ans 4th row - 相同的顶部填充。
有没有办法做到这一点?我真的很不喜欢手动更正这些填充 - 我确定 grid 有这个选项,但我找不到它。
Tnx 和这个想法
我有剑道网格,我的问题是当文本太长时,我无法使该文本断行,我尝试制作 css,但效果不佳。这是我的CSS:
#projectslistgrid .k-grid-content td{
word-wrap:break-word;
}
Run Code Online (Sandbox Code Playgroud)
这是图像:
请帮帮我,谢谢。
在剑道网格中,如何检查网格是否为空?以下给了我这个错误:
无法找到空引用的资源
$("#Product").data("kendoGrid").dataSource().length>0
Run Code Online (Sandbox Code Playgroud) kendo-grid ×10
kendo-ui ×10
asp.net-mvc ×2
css ×2
jquery ×2
telerik ×2
c# ×1
javascript ×1
kendo-mvvm ×1
razor ×1
telerik-grid ×1