我是Kendo MVC组件以及jQuery的新手.
我正在构建Kendo Grid.我想在Kendo网格上的页面加载时隐藏destroy(删除)命令.之后当我点击同一页面上的按钮时,它应该是可见的.
剑道网格:
@(Html.Kendo().Grid<Model>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(product => product.DESCRIPTION).Title("Description");
columns.Bound(product => product.CODE).Title("Description");
columns.Command(commands =>
{
commands.Destroy().HtmlAttributes(new { id = "buttondelete" });
}).Title("Operations");
})
.ToolBar(toolbar =>
{
toolbar.Create().Text("Add Records");
toolbar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable(pager => pager
.PageSizes(true)
.Input(true)
.Refresh(true)
)
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(true)
.Events(events => events.Error("onError"))
.Model(model =>
{
model.Id(product => product.ID); // Specify the property which is the unique identifier of the model
model.Field(p => p.DESCRIPTION).Editable(false);
model.Field(product => product.CODE).Editable(false);
})
.Create(create => create.Action("a", …Run Code Online (Sandbox Code Playgroud) 我在我的MVC项目上使用kendo网格.问题是,错误消息无法在视图页面上显示.当我使用谷歌的开发人员工具跟踪JSON数据时,我可以看到错误数据是正确的:
{"Data":null,"Total":0,"AggregateResults":null,"Errors":["There is record(s) with same name.Please review your new records."]}
Run Code Online (Sandbox Code Playgroud)
Expection消息已传递给控制器上的结果参数.
控制器:
catch (Exception exp)
{
var result = exp.ToDataSourceResult(request);
// var result1 = ModelState.ToDataSourceResult();
// ModelState.AddModelError("UpdateAmbulance", exp.Message);
return Json(result, JsonRequestBehavior.AllowGet);
}
Run Code Online (Sandbox Code Playgroud)
这是视图页面上的kendo网格代码:
<!-- Grid -->
@(Html.Kendo().Grid<AIS.UI.WebService.Proxy.DSrvAllService.AMBULANCEDEFINITIONS>() //Bind the grid to ViewBag.Products
.Name("grid")
// .BindTo(Model)
.Columns(columns =>
{
columns.Bound(product => product.DESCRIPTION).Title("<strong>Ambulance Description</strong>").Width("20%");
//.ClientTemplate("<strong>#:DESCRIPTION#</>strong");
columns.Bound(product => product.CODE).Title("<strong>Ambulance Description</strong>").Width("20%");
columns.Command(commands =>
{
commands.Destroy().HtmlAttributes(new { id = "buttondelete" ,style="display:none" });
}).Title("Operations").Width("10%");
})
.ToolBar(toolbar =>
{
toolbar.Create().HtmlAttributes(new { id="addbutton",style = "font-weight:bold;color:blue" }).Text("Add …Run Code Online (Sandbox Code Playgroud) 我正在使用带有ajax绑定的Kendo DropdownList.
使用这些代码,我无法设置来自model的初始值.它只是用项目填充列表并选择第一项.
@(Html.Kendo().DropDownList()
.Name("NATIONALITY")
.DataTextField("DESCRIPTION").HtmlAttributes(new { style = "width:220px" })
.DataValueField("REFERENCEID")
.Value(Model.NATIONALITY)
//Placeholder("SELECT")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetDefinitionDetails", "Definition", new { definitionCode = "NATIONALITY", addEmptyRow = false });
}).ServerFiltering(true);
}).ServerFiltering(true);
}))
Run Code Online (Sandbox Code Playgroud)
但是当我将Html.Kendo().DropDownList()更改为Html.Kendo().Combobox()时,它还会填充列表并按预期设置初始值(这是模型传递的值).
我是Knockout js的新手.想要使用knockout js在html上实现倒数计时器
为此,我在视图中添加了4个html元素(输入,跨度和开始,停止按钮).按下开始按钮时,<input>应该将写入对象的值传递给refreshViewModel,并且将有倒计时过程.当倒计时处理剩余时间将在<span>元素内部显示.如果按下停止按钮,将停止倒计时.
如果倒计时完成另一个函数(即从另一个viewModel回调),则将启动一个过滤页面的函数.
绑定文本框值以跨越值.我无法弄清楚如何计算和显示内部动态的剩余值?
HTML:
<div id="pnlTimer" class="row">
<div class="span2 pull-right" style="border:1px solid rgb(218, 218, 218)" >
<span style="font-weight:bold">Reload Interval</span>
<br />
<input id="initialTime" style="width:20px;height:14px" data-bind="value: initialTime" />
<span id="remainingTime" style="visibility:hidden"> / 15</span> second(s)
<button class="btn" style="margin-top:5px" id="StartCounter" data-bind="click: StartCounter">
<i class="icon-play"></i>
</button>
<button style="visibility:hidden;margin-top:5px;margin-left:-44px" class="btn" id="StopCounter" data-bind="click: StopCounter">
<i class="icon-stop"></i>
</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JS:
@Url.Content("~/Content/App/viewModels/listCasesViewModel.js
@Url.Content("~/Content/App/viewModels/RefreshPageTimerViewModel.js
$(document).ready(function () {
var viewModel = new ListCasesViewModel();
viewModel.init();
var pnl = $("#pnlFilterPanel").get()[0];
ko.applyBindings(viewModel, pnl); …Run Code Online (Sandbox Code Playgroud) 我试图建立一个这样的水平时间轴:
http://w3blog.fr/wp-content/uploads/2011/11/timeline-1920x1080.jpg
在页面加载时不会显示事件的详细信息(带图片中的线条的图标).在每个事件(里程碑)的点击时,将出现带有细线和图标(圆圈内部)的平滑动画并显示事件的详细信息.数据将从服务器获取,它将为hh:mm格式.所有事件将具有不同的图标,并且将有一个初始值.我看到了一些类似的演示,但它们的选项和定制有限,如下所示:
http://samuelrouse.com/jqTimeline/
http://www.jqueryscript.net/demo/Lightweight-jQuery-Timeline-Plugin-jqtimeline/
我正在尝试使用 .net Core 2.2 将我们当前的 SQL Server 数据库移动到 PostgreSQL。
我将所有表(约束、索引)、视图和存储过程转换为 Postgre SQL。我在后端保留了数据模型的所有 Dbset 配置(连接字符串除外)。
我有一个关于在 EF Core 中运行存储过程(在 Postgres 中)的问题。存储过程返回一个视图。尝试使用FromSql()来自 Ef Core 的方法将此视图映射到 DbSet 。它之前与 SQL Server 一起运行
Postgre SQL 中的存储过程:
CREATE OR REPLACE FUNCTION public.getbyusername_vw_sys_menu_lang()
RETURNS SETOF "VW_SYS_MENU_LANG"
LANGUAGE sql
AS $$
--return query
SELECT M.* FROM "VW_SYS_MENU_LANG" M
where M."USERNAME" = 'Admin' -- parameters will be added
limit 10;
$$;
Run Code Online (Sandbox Code Playgroud)
我在 .net Core 中遇到错误:
“FromSql”操作的结果中不存在所需的列“ID”。
var sql = "SELECT GETBYUSERNAME_VW_SYS_MENU_LANG()";
//var sql = "SELECT * FROM …Run Code Online (Sandbox Code Playgroud) javascript ×3
jquery ×3
kendo-ui ×3
html ×2
kendo-grid ×2
.net-core ×1
asp.net-mvc ×1
c# ×1
css ×1
css3 ×1
knockout.js ×1
postgresql ×1
telerik ×1