我有一个带有asp.net mvc语法的Kendo UI Grid.我有一个带有日期时间的列以及用于编辑的编辑器模板.当我点击编辑它显示datetimepicker但我不确定如何保持当前值(InvoicedDate)如果已存在.有任何想法吗?
编辑:当我选择日期时,它也不会将该值拉回到更新操作中.我认为问题是相关的.
发票网格:
@(Html.Kendo().Grid<TMS.MVC.TIMS.Models.Invoice.InvoiceGridModel>()
<snip>
columns.Bound(o => o.InvoicedDate).Width(100).Title("Invoice Date").Format("{0:M/d/yyyy}").EditorTemplateName("Invoice_InvoiceDate");
<snip>
Run Code Online (Sandbox Code Playgroud)
编辑模板(Invoice_InvoiceDate.cshtml):
@model TMS.MVC.TIMS.Models.Invoice.InvoiceGridModel
@(Html.Kendo().DateTimePicker()
.Name("InvoiceDate")
.Value(Model == null ? DateTime.Now : Model.InvoicedDate)
.Format("M/d/yyyy h:mm tt")
)
Run Code Online (Sandbox Code Playgroud) 我试图用一些嵌套网格设置一个kendo标签.第一个选项卡可以使用嵌套网格加载,但是,当我单击第二个选项卡时,tabStrip不会切换到第二个选项卡.我甚至从kendo下载了这个例子,它也不起作用!我已导入所有kendo js文件(包括.all和.tabstrip文件).但它不起作用.我使用jquery 1.7和MVC 4.这是我从kendo网站获得的示例.除此之外,O还有他们提供的css.有任何想法吗?提前致谢!
<div id="forecast">
@(Html.Kendo().TabStrip()
.Name("Menu")
.Items(tabstrip =>
{
tabstrip.Add().Text("Paris")
.Selected(true)
.Content(@<text>
<div class="weather">
<h2>17<span>ºC</span></h2>
<p>Rainy weather in Paris.</p>
</div>
<span class="rainy"> </span>
</text>);
tabstrip.Add().Text("New York")
.Content(@<text>
<div class="weather">
<h2>29<span>ºC</span></h2>
<p>Sunny weather in New York.</p>
</div>
<span class="sunny"> </span>
</text>);
tabstrip.Add().Text("Moscow")
.Content(@<text>
<div class="weather">
<h2>16<span>ºC</span></h2>
<p>Cloudy weather in Moscow.</p>
</div>
<span class="cloudy"> </span>
</text>);
tabstrip.Add().Text("Sydney")
.Content(@<text>
<div class="weather">
<h2>17<span>ºC</span></h2>
<p>Rainy weather in Sidney.</p>
</div>
<span class="rainy"> </span>
</text>);
})
)
Run Code Online (Sandbox Code Playgroud)
我的数据列表视图网格结构是这样的.
<div id="listView">
<div class="product"><h3>India</h3></div>
<div class="product1"><h3>Gujarat</h3></div>
<div class="product"><h3>Surat</h3></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我想设置数据源具有类product1的新数据.
恩.喜欢
<div class="product1"><h3>Gujarat</h3></div>
Run Code Online (Sandbox Code Playgroud)
我想把古吉拉特改成其他名字.
我使用下面的代码,但这只设置第一个元素,而不是检查特定的类.
var firstItem = $('#listView').data().kendoListView.dataSource.data()[0];
firstItem.set('name','The updated Name');
Run Code Online (Sandbox Code Playgroud)
如果你知道的话,请回复解决方案.
我有一个kendo下拉列表的问题.Drop down返回对象对象,但我需要字符串.有人可以帮助我.这里是代码.对不起我的英语,我来自俄罗斯
MyScript.js :(从Admin控制器获取数据)
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
type: 'odata',
serverSorting: true,
serverFiltering: true,
serverPaging: true,
transport: {
read: {
url: "/api/Admin",
dataType: "json",
contentType: "application/json",
},
create: {
url: "/api/Admin",
dataType: "json",
type: "POST"
},
update: {
url: function (AdminModel) {
return "/api/Admin/" + "?roles=" + AdminModel.Roles
},
dataType: "json",
type: "PUT"
},
destroy: {
url: function (AdminModel) {
return "/api/Admin/" + "?name=" + AdminModel.Name
},
dataType: "json",
type: "DELETE"
},
parameterMap: function (model, operation) {
if …Run Code Online (Sandbox Code Playgroud) 我有一个带有编辑命令的Kendo(2013.2.716)网格(编辑按钮位于第一列)和40多个其他列.我没有Grid的Selectable设置.当填充网格时,我可以在编辑命令列中运行鼠标,并依次突出显示每个编辑按钮,当我单击一个时,我的编辑器立即出现.
但是,如果没有.Selectable选项,如果我滚动网格以查看40多列,我无法确定我在哪一行.所以,我设置.Selectable().这给了我突出显示的背景,无论何时我连续点击一下.但是,我有两个负面的副作用:第一,选择一个新行只需要6秒钟来改变(并突出显示)一个新行,而另外两个,点击编辑按钮现在什么都不做:没有编辑器出现.
文档说,"只需将selectable选项设置为true即可在网格中启用选择." 但它必须有更多...它不应该花费任何时间来改变背景颜色,它不应该杀死我的编辑按钮.我错过了什么?
@(Html.Kendo().Grid(Model.Data)
.Columns(columns =>
{
columns.Command(command => command.Edit().Text("Edit").UpdateText("Submit")).Width(97).HtmlAttributes(new { style = "text-align: center;" });
...
})
.Selectable( )
.Editable(editable => editable
.Mode(GridEditMode.PopUp)
.TemplateName("MyEditor")
.Window(w => w.Width(500))
.Window(w => w.Title("My Editor")))
Run Code Online (Sandbox Code Playgroud) 我有一个分层网格.如何在网站加载时避免扩展第一行?
问候
在剑道网格中有一个名为"过滤行"的功能
http://demos.telerik.com/kendo-ui/grid/filter-row
我想在过滤器框中添加一个下拉列表而不是文本框或数字框.它用于过滤具有国家/地区的列.所以我想要一个下拉列表中的国家列表.我怎样才能做到这一点?
在这里将问题作为答案发布后,我通过创建新问题来纠正此问题.
我正在尝试在kendo网格中创建行过滤器,以显示该列中可能值的DropDown.到目前为止,我得到的最接近的是Pluc 在链接问题中的例子.它仍然没有按预期工作.
在kendoGrid的列中,我定义了一个这样的字段:
{
field: "Herkunft",
title: "Herkunft",
width: "120px",
type: "string",
filterable:
{
cell:
{
showOperators: false,
template: herkunftDropDownEditor
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是herkunftDropDownEditor函数:
function herkunftDropDownEditor(element) {
element.kendoDropDownList({
autoBind: false,
optionLabel: "--Select Value--",
dataTextField: "Value",
dataValueField: "Value",
valuePrimitive: true,
dataSource: herkunftDataSource
});
}
Run Code Online (Sandbox Code Playgroud)
和下拉列表的数据源:
var herkunftDataSource = new kendo.data.DataSource({
data: [
{ Value: "Choice One" },
{ Value: "Choice Two" }
]
});
Run Code Online (Sandbox Code Playgroud)
它不起作用.我在Chrome中遇到的JS错误就行了:
element.kendoDropDownList({
Run Code Online (Sandbox Code Playgroud)
错误说:"Uncaught TypeError: undefined is not a function".由于某种原因它不能使用kendoDropDownList函数.
我也觉得令人困惑的是Telerik在他们的例子中使用模板template: …
我使用Kendo UI网格,并使用自定义模板进行弹出式添加/编辑表单。这是我的演示。
仅在编辑记录时,我要在弹出表单中隐藏FirstName和LastName输入字段,而不要在“添加”上。
有谁知道该怎么做?谢谢。
下面是我的代码:
HTML:
<!-- grid element -->
<div id="grid" style="width: 700px; margin: 0 auto;"></div>
<!-- popup editor template -->
<script id="popup_editor" type="text/x-kendo-template">
<p>Custom editor template</p>
<div class="k-edit-label">
<label for="FirstName">First Name</label>
</div>
<!-- autoComplete editor for field: "FirstName" -->
<input type="text" class="k-input k-textbox" data-bind="value:FirstName"/>
<div class="k-edit-label">
<label for="LastName" style="color: red;">Last Name</label>
</div>
<input type="text" class="k-input k-textbox" name="LastName" data-bind="value:LastName">
<div class="k-edit-label">
<label for="BirthDate">Birth Date</label>
</div>
<!-- datepicker editor for …Run Code Online (Sandbox Code Playgroud) 我正在Angular 5 Visual Studio 2017版本15.6.7 TargetFramework中进行此开发-netcoreapp2.0 rxjs:5.5.10
我无法摆脱这个错误:
错误错误:未捕获(承诺):错误:StaticInjectorError(AppModule)[VtoReportComponent-> Vtos]:StaticInjectorError(平台:核心)[VtoReportComponent-> Vtos]:NullInjectorError:没有Vtos提供者!
这是vto.service.ts
import { Component, OnInit } from '@angular/core';
import { Http, HttpModule } from '@angular/http';
import { Observable } from 'rxjs';
import { GroupDescriptor, DataSourceRequestState, DataResult, process, State } from '@progress/kendo-data-query';
import { ExcelExportData } from '@progress/kendo-angular-excel-export';
import { aggregateBy, SortDescriptor, orderBy } from '@progress/kendo-data-query';
import { Vtos } from '../../services/vto.service';
import {
GridComponent,
GridDataResult,
DataStateChangeEvent
} from '@progress/kendo-angular-grid';
@Component({
selector: 'app-vto-report',
templateUrl: './vto-report.component.html',
styleUrls: ['./vto-report.component.css']
})
export class …Run Code Online (Sandbox Code Playgroud) kendo-grid ×10
kendo-ui ×5
asp.net-mvc ×3
c# ×2
jquery ×2
telerik ×2
angular5 ×1
javascript ×1
promise ×1
telerik-grid ×1