or
$("#window").kendoWindow({
actions: ["Custom", "Minimize", "Maximize", "Close"],
title: "Window Title"
}).data("kendoWindow").wrapper.find(".k-custom").click(function(e) {
alert("Custom action button clicked");
e.preventDefault();
});
function popStateHandler(e) { var State = e.state; if (State != null) { console.log(State); switch (State.stateTitle) { case "Landing Page": console.log('transitioning to landing page ...'); // show the content div and hide the hide the login panel // Transitions.PrimaryElementTransitions.HideLoginPanel(); break; default: break; } // end switch ... } else if (window.processingLogin == true) { console.log('Processing login flag is true.'); window.ProcessingLogin = false; } else { console.log('transitioning to login state ...'); // show the login panel and hide the content div // Transitions.PrimaryElementTransitions.ShowLoginPanel(); }}// Attach the window.history popstate event handler defined above.//window.addEventListener("popstate", popStateHandler, false); // end function definition and addEventListener method invocation ...Kendo Hello Friends Have a grid with inline editing and to 3 drop-down lists. The display and fill the drop-down lists ok. Works but if I want to save changes, so do not get the desired data to the controller? The list the values I need are the IDs of the selected items from the drop! But come on, only the new text of the drop-down lists for the controller.
Here is my code and annexed the image on the controller
function loadTable() { var dataSource = new kendo.data.DataSource({ transport: { read: { url: "/Customer/LoadOperatingPictureTable", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", data: {} }, update: { url: "/Customer/UpdateAnimalValues", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8" }, parameterMap: function (data, operation) { if (operation !== "read") { return JSON.stringify({ model: data }); } } }, autoSync: false, schema: { model: { id: "Id", fields: { Id: { editable: false, nullable: true }, Name: { editable: false }, AnimalCount: { type: "number", validation: { required: { message: "Das Feld darf nicht leer sein!" } } }, Distributor: { editable: true }, Label: { editable: true }, Marketer: { editable: true } } } }, error: function (e) { alert(e.status + ' ' + e.statusText); } }); $("div#operatingPictureTable").kendoGrid({ dataSource: dataSource, scrollable: true, sortable: true, editable: "inline", columns: [ { field: "Name", title: "Tierkategorie" }, { field: "AnimalCount", title: "Anzahl Tiere", template: '<div style="text-align: right">#= AnimalCount #</div>', width: 80 }, { field: "Distributor", title: "Lieferant", editor: onDrpDistributor }, { field: "Label", title: "Label", editor: onDrpLabel }, { field: "Marketer", title: "Vermarkter", editor: onDrpMarketer }, { command: "edit", titel: " ", width: 110 } ], }); function onDrpDistributor(container, options) { $('<input name="Distributors" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ dataTextField: "Value", dataValueField: "Id", autoBind: false, dataSource: new kendo.data.DataSource({ transport: { read: { url: "/Main/GetDistributors", dataType: "json" }, schema: { model:{ id: "Id", value: "Value" } } } }) }); } function onDrpLabel(container, options) { $('<input name="Distributors" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ dataTextField: "Value", dataValueField: "Id", autoBind: false, dataSource: { type: "json", transport: { read: "/Main/GetLabels" } } }); } function onDrpMarketer(container, options) { $('<input name="Distributors" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ dataTextField: "Value", dataValueField: "Id", autoBind: false, dataSource: { type: "json", transport: { read: "/Main/GetMarketers" } } }); }}<body> <h2>Kendo Editor Example</h2><textarea cols="20" id="Description" name="Description" rows="5" style="width:600px; height:400px"></textarea><script> jQuery(function(){jQuery("#Description").kendoEditor({tools:[{name:"bold"},{name:"italic"},{name:"createLink"},{name:"unlink"},{name:"Insert Video",tooltip:"Insert Video",exec:insertVideo},{name:"insertImage"},{name:"insertUnorderedList"},{name:"formatBlock"}]});});</script><script type="text/x-kendo-template" id="insertVideo-template"> <div> <label for="videoUrl">Enter a URL from YouTube or Vimeo:</label> <input type="text" id="videoUrl" name="videoUrl"/> <div class="insertVideo-actions"> <button class="k-button insertVideo-insert">Insert</button> <button class="k-button insertVideo-cancel">Cancel</button> </div> </div></script><script type="text/x-kendo-template" id="youTube-template"> <iframe class="youtube-player" type="text/html" width="560" height="315" src="http://www.youtube.com/embed/#= source #?fs=1&feature=oembed&wmode=transparent" frameborder="0" allowfullscreen></iframe></script><script> function insertVideo(e) { var editor = $(this).data("kendoEditor"); var dialog = $($("#insertVideo-template").html()) .find(".insertVideo-insert") .click(function () { var media = testUrlForMedia(dialog.element.find("input").val()); if (media) { var template = kendo.template($("#youTube-template").html()); editor.exec("insertHTML", { value: template({ source: media.id }) }); } dialog.close(); }) .end() .find(".insertVideo-cancel") .click(function() { dialog.close(); }) .end() .kendoWindow({ modal: true, title: "Insert Video", deactivate: function() { dialog.destroy(); } }).data("kendoWindow"); dialog.center().open(); } function testUrlForMedia(pastedData) { var success = false; var media = {}; if (pastedData.match('http://(www.)?youtube|youtu\.be')) { if (pastedData.match('embed')) { youtube_id = pastedData.split(/embed\//)[1].split('"')[0]; } else { youtube_id = pastedData.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; } media.type = "youtube"; media.id = youtube_id; success = true; } else if (pastedData.match('http://(player.)?vimeo\.com')) { vimeo_id = pastedData.split(/video\/|http:\/\/vimeo\.com\//)[1].split(/[?&]/)[0]; media.type = "vimeo"; media.id = vimeo_id; success = true; } else if (pastedData.match('http://player\.soundcloud\.com')) { soundcloud_url = unescape(pastedData.split(/value="/)[1].split(/["]/)[0]); soundcloud_id = soundcloud_url.split(/tracks\//)[1].split(/[&"]/)[0]; media.type = "soundcloud"; media.id = soundcloud_id; success = true; } if (success) { return media; } else { alert("No valid media id detected"); } return false; }</script>