如何比较 Kendo 网格弹出窗口中具有不同值的两个文本框
how to compare two textboxes with different values in Kendo grid pop up
@(Html.Kendo().Grid<CRMVehicleViewModel>()
.Name("CompanyGrid")
.Columns(columns =>
{
columns.Bound(p => p.VehicleId).Hidden(true);
columns.Bound(p => p.RegNo);
columns.ForeignKey(p => p.FranchiseCode, (System.Collections.IEnumerable)ViewData["FranchiseCode"], "Value", "Text").EditorTemplateName("GridForeignKey").Title("Franchise Code").Width(150);
columns.ForeignKey(p => p.Model, (System.Collections.IEnumerable)ViewData["ModelCode"], "Value", "Text").EditorTemplateName("GridForeignKey").Title("Model Code").Width(150);
columns.ForeignKey(p => p.Variant, (System.Collections.IEnumerable)ViewData["VariantCode"], "Value", "Text").EditorTemplateName("GridForeignKey").Title("Variant Code").Width(150);
columns.Bound(p => p.EngNo);
columns.Bound(p => p.chessisno);
columns.Bound(p => p.Description);
columns.Command(command => { command.Destroy().Text(" ");command.Create().Text(" ") }).Title("Action").Width(100);
})
.ToolBar(toolbar =>
{
{ toolbar.Create(); }
})
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable(p => p.Numeric(false).PreviousNext(false))
.Sortable()
.Scrollable(sc => sc.Endless(true))
.HtmlAttributes(new { style = "height:90%;" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(20)
.Model(model => model.Id(p => p.VehicleId))
.Read(read => read.Action("GetVehicles", "CRM"))
.Create(create => create.Action("AddVehicles", "CRM"))
.Destroy(update => update.Action("DeleteVehicles", "CRM"))
).Events(e => e.Edit("onEdit")))
<script>
function onEdit(e) {
var _txt1 = e.container.find("input:EngNo").val();
var _txt2 = e.container.find("input:chessisno").val();
if (_txt1 == _txt2) {
alert('Matching!');
return true;
}
else {
alert('Not matching!');
return false;
}
}
</script>
我想转换文本框 'EngNo' 和文本框 'ChessisNo',从弹出窗口插入前两个字段必须不同 window,我已经添加了脚本,但它不起作用,请帮忙我来解决这个问题。
<script>
function onEdit(e) {
var _txt1 = e.container.find("input[name='EngNo']").val() ;
var _txt2 = e.container.find("input[name='chessisno']").val();
if (_txt1 == _txt2) {
alert('Matching!');
return true;
}
else {
alert('Not matching!');
return false;
}
}
</script>
@(Html.Kendo().Grid<CRMVehicleViewModel>()
.Name("CompanyGrid")
.Columns(columns =>
{
columns.Bound(p => p.VehicleId).Hidden(true);
columns.Bound(p => p.RegNo);
columns.ForeignKey(p => p.FranchiseCode, (System.Collections.IEnumerable)ViewData["FranchiseCode"], "Value", "Text").EditorTemplateName("GridForeignKey").Title("Franchise Code").Width(150);
columns.ForeignKey(p => p.Model, (System.Collections.IEnumerable)ViewData["ModelCode"], "Value", "Text").EditorTemplateName("GridForeignKey").Title("Model Code").Width(150);
columns.ForeignKey(p => p.Variant, (System.Collections.IEnumerable)ViewData["VariantCode"], "Value", "Text").EditorTemplateName("GridForeignKey").Title("Variant Code").Width(150);
columns.Bound(p => p.EngNo);
columns.Bound(p => p.chessisno);
columns.Bound(p => p.Description);
columns.Command(command => { command.Destroy().Text(" ");command.Create().Text(" ") }).Title("Action").Width(100);
})
.ToolBar(toolbar =>
{
{ toolbar.Create(); }
})
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable(p => p.Numeric(false).PreviousNext(false))
.Sortable()
.Scrollable(sc => sc.Endless(true))
.HtmlAttributes(new { style = "height:90%;" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(20)
.Model(model => model.Id(p => p.VehicleId))
.Read(read => read.Action("GetVehicles", "CRM"))
.Create(create => create.Action("AddVehicles", "CRM"))
.Destroy(update => update.Action("DeleteVehicles", "CRM"))
).Events(e => e.Edit("onEdit")))
<script>
function onEdit(e) {
var _txt1 = e.container.find("input:EngNo").val();
var _txt2 = e.container.find("input:chessisno").val();
if (_txt1 == _txt2) {
alert('Matching!');
return true;
}
else {
alert('Not matching!');
return false;
}
}
</script>
我想转换文本框 'EngNo' 和文本框 'ChessisNo',从弹出窗口插入前两个字段必须不同 window,我已经添加了脚本,但它不起作用,请帮忙我来解决这个问题。
<script>
function onEdit(e) {
var _txt1 = e.container.find("input[name='EngNo']").val() ;
var _txt2 = e.container.find("input[name='chessisno']").val();
if (_txt1 == _txt2) {
alert('Matching!');
return true;
}
else {
alert('Not matching!');
return false;
}
}
</script>