<div id="mydiv"> <div id="listView" data-role="listview" data-editable="true" data-template="my-template" data-bind="source: MySource"> </div> </div><script id="my-template" type="text/x-kendo-template"> <div>${Status}</div> <div> # if (Status.toUpperCase() == "SINGLE"){# <img src="imgs/black_acs.png" alt="black_acs image" /> #}else if (Status.toUpperCase() == "MARRIED"){# <img src="imgs/blue_acs.png" alt="blue_acs image" /> #}else if (Status.toUpperCase() == "OTHER"){# <img src="imgs/red_acs.png" alt="red_acs image" /> #}# </div></script><script>$(document).ready(function () { var viewModel = kendo.observable({ MySource: new kendo.data.DataSource({ // name and status transport: { read: { type: "GET", dataType: "json", contentType: "application/json; charset=utf-8", data: function () { var jsonParameters = {}; jsonParameters.parameter = "XXX"; return jsonParameters; } } } }); kendo.bind($("#mydiv"), viewModel);});</script><script id="my-template" type="text/x-kendo-template"> <div>${Status}</div> <div> # if (Status.toUpperCase() == "SINGLE"){# <img src="imgs/black_acs.png" alt="black_acs image" /> #}else if (Status.toUpperCase() == "MARRIED"){# <img src="imgs/blue_acs.png" alt="blue_acs image" /> #}else if (Status.toUpperCase() == "OTHER"){# <img src="imgs/red_acs.png" alt="red_acs image" /> #}# </div></script><script> $(document).bind("TEMPLATE_LOADED", function (e, data) { _itemTemplate = kendo.template($("#my-template").html(), { useWithBlock: false }); _itemTemplate(data); bindMe(); });$(document).ready(function () { templateLoader.loadExtTemplate("template1.tmpl.htm"); });function bindMe(){ var viewModel = kendo.observable({ MySource: new kendo.data.DataSource({ // name and status transport: { read: { type: "GET", dataType: "json", contentType: "application/json; charset=utf-8", data: function () { var jsonParameters = {}; jsonParameters.parameter = "XXX"; return jsonParameters; } } } }); kendo.bind($("#mydiv"), viewModel); }</script><script id="my-template" type="text/x-kendo-template"> <div>fixed text</div></script>$(document).ready(function () { var viewModel = kendo.observable({ order : { allocations: [], yieldCalcs: [], TradeDate: "", SettleDate: "", EventType:"", TrustCode: "", Broker: "", BondProceeds: function(){ return this.get("UnderlyingPar") * (this.get("UnderlyingPrice")/100) + this.get("UpfrontFees"); }, UnderlyingPar: "", TrustFee: "", RemarkFee: ".", WrapFee: "", LiquidFee: "", BMASIFMA: "", UnderlyingPrice: "", UpfrontFees: "", FloaterAmount:"", InverseFloatPar:"", LeverageRatio: function(){ return this.get("FloaterAmount")/this.get("InverseFloatPar"); }, ResidualYield: function(){ }, ResidualAmount: "", ResidualPrice: function(){ return this.TotalAmount()/this.get("InverseFloatPar")*100; }, InterestOnFloat: function(){ return this.get("FloaterAmount")*this.get("BMASIFMA"); }, InterestOnAssets: function(){ return this.get("UnderlyingPar") * this.get("UnderlyingCoupon"); }, ProgramFees: function(){ return (this.get("UnderlyingPar") * (this.get("TrustFee") + this.get("WrapFee"))) + (this.get("FloaterAmount") * (this.get("RemarkFee") + this.get("LiquidFee"))); }, UnderlyingYield: ".0375", UnderlyingCoupon: ".05", TerminationDate:"", EffectiveCoupon: function(){ return (this.InterestOnAssets() - this.InterestOnFloat() - this.ProgramFees())/this.get("InverseFloatPar"); }, TotalAmount: function(){ return this.get("UnderlyingPar") * (this.get("UnderlyingPrice")/100) - this.get("FloaterAmount"); }, ResAccInt: function(){ } }, yieldSource: new kendo.data.DataSource({ pageSize: 1, data: this.order, transport: { read: { url: "@Url.Action("GetYield","Home")", dataType: "json" }, create : { url: "@Url.Action("GetYield","Home")", dataType: "json" } }, schema: { model: { fields: { SettleDate: { Type: "Date", validation: {required: true }}, TerminationDate: {Type: "Date", validation: {required: true }}, EffectiveCoupon: { Type: "Number", validation: {required: true }}, ResidualPrice: { Type: "Number",validation: {required: true }}, EffectiveCoupon: {Type: "Number",validation: {required: true}}, ResidualYield: {Type: "Number",validation: {required: true}}, ResidualPrice: {Type: "Number",validation: {required: true}}, InverseFloatPar: {Type: "Number",validation: {required: true}}, LeverageRatio: {Type: "Number",validation: {required: true}}, UnderlyingPar: {Type: "Number",validation: {required: true}}, UnderlyingPrice: {Type: "Number",validation: {required: true}}, UnderlyingYield: {Type: "Number",validation: {required: true}}, UnderlyingCoupon: {Type: "Number",validation: {required: true}}, EventType: {Type: "Number",validation : {required: true}}, TrustCode: {Type: "Number",validation : {required: true}}, Broker: {Type: "Number",validation : {required: true}}, BondProceeds: {Type: "Number",validation : {required: true}}, BMASIFMA: {Type: "Number",validation : {required: true}}, WrapFee: {Type: "Number",validation : {required: true}}, RemarkFee: {validation : {required: true}}, LiquidFee: {validation : {required: true}}, ResccInt: {validation : {required: true}}, TotalAmount: "TotalAmount" } } }, parameterMap: function(options, operation){ if(operation=="create"){ console.log(options); return { models: kendo.stringify(options.models)}; } return options; } }), addYieldValues: function(){ this.yieldSource.add(this.viewModel); this.yieldSource.sync(); },Hai
I am creating a MVC4 razor Application using Kendo controls. In my application I supposed to open a view as popup. For that I am using kendow window control. Am using the below code to open the popup.
@(Html.Kendo().Window()
.Name("Searchwindow")
.Title("user Search")
.LoadContentFrom("../usersearch")
.Draggable()
.Resizable()
.Width(700)
.Visible(false)
The view is open as popup and works fine. But whenever the post action occurs in the view the page is opened as page like http://localhost:4376/usersearch.
I have to show the same popup to the user when the form is posted. How to show the same popup when an action is posted on the view page? Is it possible to open the view as popup after the action completion?
Thanks
@(Html.Kendo().Menu() .Name("ProductBookMenu") .OpenOnClick(true) .CloseOnClick(true) .Items(items => { items.Add() .Text("Product Book") .Content(Html.Partial("ProductBook", Model.ItemModelList).ToHtmlString()); }))@model List<Company.Product.MVC.Models.ItemModel>@using Kendo.Mvc.UI<script>function PopulateItemGrid() { var productBookGrid = $("#ProductBookGrid").data("kendoGrid"); var itemGrid = $("#QuoteItemGrid").data("kendoGrid"); productBookGrid.select().each(function () { var dataItem = productBookGrid.dataItem($(this)); itemGrid.dataSource.add(dataItem); }); $("#ProductBookMenu").data("kendoMenu").close("#Item1");}</script>@(Html.Kendo().Grid(Model) .Name("ProductBookGrid") .Columns(columns => { columns.Bound(i => i.FreightClass).Width(70); columns.Bound(i => i.DimensionLength).Width(70); columns.Bound(i => i.DimensionWidth).Width(70); columns.Bound(i => i.DimensionHeight).Width(70); columns.Bound(i => i.DimensionUnitOfMeasure).Width(70); columns.Bound(i => i.QuantityQuantityValue).Width(70); columns.Bound(i => i.QuantityUnitOfMeasure).Width(70); columns.Bound(i => i.WeightWeightValue).Width(70); columns.Bound(i => i.WeightUnitOfMeasure).Width(70); columns.Bound(i => i.NmfcCode).Width(75); columns.Bound(i => i.ItemDescription).Width(150); }) .ToolBar(toolbar => { toolbar.Custom().Text("Add").Url("#_").HtmlAttributes(new { onclick = "PopulateItemGrid()" }); }) .Pageable() .Sortable() .Scrollable() .Filterable() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .DataSource(dataSource => dataSource .Ajax() ) .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple)))