or
$("#algType").kendoDropDownList({ change: function () { algType = $("#algType").data("kendoDropDownList").value(); $("#substn").kendoDropDownList({ dataTextField: "Substn", dataValueField: "SubstnID", dataSource: substnDataSource, change: function () { algType = $("#algType").data("kendoDropDownList").value(); substn = $("#substn").data("kendoDropDownList").value(); $("#devtyp").kendoDropDownList({ dataTextField: "Devtyp", dataValueField: "DevtypID", dataSource: devtypDataSource }); } }); }});valueAxis: { line: { visible: false }}_wrapper: function() { var that = this, element = that.element, wrapper; wrapper = element.parents(".k-datepicker"); if (!wrapper[0]) { wrapper = element.wrap(SPAN).parent().addClass("k-picker-wrap k-state-default"); wrapper = wrapper.wrap(SPAN).parent(); } wrapper[0].style.cssText = element[0].style.cssText; element.css({ width: "100%", height: "auto" }); that.wrapper = wrapper.addClass("k-widget k-datepicker k-header"); that._inputWrapper = $(wrapper[0].firstChild); }_wrapper: function() { var that = this, element = that.element, wrapper; wrapper = element.parent(); if (!wrapper.is("span.k-widget")) { wrapper = element.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(); wrapper = wrapper.wrap("<span/>").parent(); } wrapper[0].style.cssText = element[0].style.cssText; that.wrapper = wrapper.addClass("k-widget k-numerictextbox").show(); that._inputWrapper = $(wrapper[0].firstChild); }$("#numeric").kendoNumericTextBox();wrapper = element.parents('.k-numerictextbox'); if (!wrapper.is(".k-numerictextbox")) { wrapper = element.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(); wrapper = wrapper.wrap("<span/>").parent();}<input id="dropdownlist" /><script type="text/javascript">$(document).ready(function() { $("#dropdownlist").kendoDropDownList([{text: "Item1", value: "1"}, {text: "Item2", value: "2"}]);});</script>Hi,
I need the ability to have the following:
1) Set the selected date of the datepicker in a grid.
2) Format the date picker and the date in the grid column.
Here is my code for you:
$(document).ready(function () { //kendo.toString(new Date(), "MM/dd/yyyy") dataSource = new kendo.data.DataSource({ serverPaging: true, serverSorting: true, batch: true, pageSize: 100, transport: { read: { url: "@Url.Action("Read", "Animals")", type: "POST" }, update: { url: "@Url.Action("Update", "Animals")", type: "POST" }, parameterMap: function (data, operation) { alert(operation); if (operation != "read") { // post the Animals so the ASP.NET DefaultModelBinder will understand them: var result = {}; //alert(data.models.length); //alert(data.models); for (var i = 0; i < data.models.length; i++) { var animal = data.models[i]; for (var member in animal) { result["animals[" + i + "]." + member] = animal[member]; } } return result; } }}, schema: { model: { id: "AnimalId", fields: { AnimalId: { editable: false, nullable: false }, Name: {editable: true, nullable: false, validation: { required: true }}, Description: {editable: true, nullable: false, validation: { required: false }}, FatherName: {editable: false}, MotherName: {editable: false}, BeginDate: {type: "date", editable:true, nullable:true, validation: { required: true }}, EndDate: {type: "date", editable:true, nullable:true, validation: { required: true }} }}}, success: function (data) { debugger; alert(data.d.Text); }, error: function (xmlHttpRequest) { debugger; alert("Sorry, we encountered the error: " + xmlHttpRequest.responseXML.text + " Please try again."); } }); $("#grid").kendoGrid({ dataSource: dataSource, scrollable: { virtual: true }, toolbar: ["create", "save", "cancel"], sortable: true, columns: [{ field: "Name" }, { field: "Description"}, { field: "BeginDate", title: "Date of Birth"}, { field: "EndDate", title: "Date of Death"}, { field: "FatherName", title: "Father"}, { field: "MotherName", title: "Mother"}], editable: true }); })
Thanks for your help!