I have an MVC grid with a datetime column. I am using the Kendo DatePicker for the column. Edit mode for the grid is set to InLine. When the user clicks on the row, the row goes into edit mode. The datePicker for my datetime column displays correctly but when I click on the date icon to display the calendar, nothing happens.
The MVC code for the column looks like this:
columns.Bound(p => p.DateOfSale).Title("Date of Sale").EditorTemplateName("DatePicker").ClientTemplate("#= DateOfSale ? moment.utc(DateOfSale,'MM/DD/YYYY').format('MM/DD/YYYY') : ''#").Width(120);
My DatePicker code is this:
@using Kendo.Mvc.UI
@model DateTime?
@(Html.Kendo().DatePickerFor(m => m)
.Format("MM/dd/yyyy")
)
Hi,
I have a dataSource with a number of fields. Is there any way to get the list of these fields, in the order specified when the datasource was created.
I know I can get the list by using dataSource.options.schema.model.fields, however the order in alphabetical and not in the order I used when I created the datasource.
Thanks!
Is it possible to paste data from Excel and have the create method fire to append each inserted row?
The example from the documentation (http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/excel/copy-from-excel-to-grid) simply replaces the existing grid's datasource whereas I would like to append each row that is pasted in so that it maintains the existing data and adds the newly pasted data.
My example Grid currently looks like:
@(Html.Kendo().Grid<InvoiceDetailVM>()
.Name("MyGrid")
.Columns(columns =>
{
columns.Bound(p => p.ID).Hidden();
columns.Bound(p => p.Description);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(250);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax()
.PageSize(25)
.Events(events => events.Error("window.KendoGrid_Error"))
.Model(model =>
{
model.Id(i => i.ID); // Specify the property which is the unique identifier of the model.
model.Field(i => i.ID).Editable(false);
})
.Create(update => update.Action("Create", "Test"))
.Read(read => read.Action("Read", "Test"))
.Update(update => update.Action("Edit"))
.Destroy(update => update.Action("Delete", "Test"))
)
)
Any help would be appreciated.
Thanks!
Hello-
I have an ObservableObject bound to a remote datasource, and the ObservableObject is bound to form fields with MVVM.
I currently have a 1-1 relationship between the field and the form input. However, I want to change that so there is a single field for multiple controls. For example...
Current
isClient database field (boolean) --> isClient checkbox
isPrimeClient database field (boolean) --> isPrimeClient checkbox
Desired
clientType database field (integer) --> isClient checkbox, isPrimeClient checkbox
I think I can use binding to the observable's "get" and "set" events...
observable.bind("set", function (e) {
if ((e.field === "isClient") || (e.field === "isPrimeClient")) {
let isClient = observalbe.get("isClient");
let isPrimeClient = observalbe.get("isPrimeClient");
//// Some logic to determine appropriate value for clientType /////
observable.set("clientType",somevalue);
}
});
observable.bind("get", function (e) {
if (e.field === "isClient") {
//Look at clientType integer value and set e.value (for isClient) appropriately.
let clientType = observable.get("clientType");
e.value = //// some logic to determine appropriate value ////
}
else if(e.field === "isPrimeClient"){
//Look at clientType integer value and set e.value (for isPrimeClient) appropriately.
let clientType = observable.get("clientType");
e.value = //// some logic to determine appropriate value ////
}
});
However, observable.get(...) always returns null. Why is that?
Basically what I'm trying to do is take a single field from the back-end and render two controls for it.
Hello,
Please help me resolve the bug In timelineWeek view when shown only business hours.
If there is an event that star and end in off hours, timelineWeek did not show event, and breaks - see attach.
Here is live example http://dojo.telerik.com/iVAFa/2
Event with this dates breaks "timelineWeek business hours" view
"Start": new Date("2017/2/16 17:00"),
"End": new Date("2017/2/17 17:00"),
Are there demos for the following widgets:
Prompt, Dialog, Notification, Popup, PanelBar
I have a custom button on scheduler's toolbar and on "onclick" event I'm calling function "openEditor()". Inside this function I want to call a `text/x-kendo-template` script type. How can I do this?
My code right now:
Custom button:
schedulerToolbar.append(
"<
ul
class
=
'k-reset'
>
<
li
class
=
'k-state-default'
>
<
a
role
=
'button'
href
=
'#'
class
=
'k-link newMeetingButton'
onclick
=
'openEditor()'
>
Nova reserva
</
a
>
</
li
>
</
ul
>"
)
Function openEditor():
function openEditor() {
*code to call customEditorTemplateBh script*
}
Template script:
<
script
id
=
"customEditorTemplateBh"
type
=
"text/x-kendo-template"
>
*template code*
</
script
>