Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a gridview in which I have 5 columns for example. After the grid is loaded with data from db, I will have the first column designed with a dropdown using jquery. I plan to enhance the second column to become a datetime picker by using jquery too. I have successfully added the dropdown but when I added also the datetime picker, the dropdown will become datetime picker too.
I suspect the jquery is conflict between these 2 setting in the "apppendTo(container)" but would not sure how to change it as I am still newbie in jquery and have search online materials for reference but to no avail. Below are my codes:

grid = $('#gdInformation').kendoGrid($.extend({
      //some setting here
       columns: [
       { field: "Region", title: "Region", width: 120,  editor: regionDropDownEditor},
       { field: "DateStart", title: "Date Start", editor: dateTimeEditor}]
}));



function regionDropDownEditor(container, options) {
    $('<input data-bind = "value: Region" required name"' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            dataTextField: "Region",
            dataValueField: "Region",
            dataSource: _regionNames //array containing items
        });
};
function dateTimeEditor(container, options) {
    $('<input data-bind = "value: DateStart" required name"' + options.field + '"/>')
        .appendTo(container)
        .kendoDateTimePicker({
            value: new Date(),
            dateInput: true,
            format: "MM/dd/yyyy HH:mm:ss"
        });
};


I am quite sure the problem is coming from the "appendTo()" but how I need to change it? Thank you.

What I have tried:

1. Change the "appendTo(container)" into "appendTo(options.field)" but to no avail.
2. Search internet for reference but only found the appendTo() basic usage.
Posted
Comments
Graeme_Grant 14-Nov-17 22:40pm    
Someone here may be familiar with the 3rd-party Telerik Kendo libraries however you may find or get a quicker response in the Telerik Developer Forums[^]...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900