This is a migrated thread and some comments may be shown as answers.

[Solved] Grid with Custom Popup Editor containing DatePicker

0 Answers 539 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Philipp
Top achievements
Rank 1
Philipp asked on 07 Sep 2012, 01:42 PM
I'm trying to get the DatePicker inside my grid's custom popup editor to init/show the Date from my DataSource ...
Here's a fiddle to show you what I mean: http://jsfiddle.net/kzpzC/4/

<div id="grid" class="k-content clearfix"></div>

<script id="templ" type="text/x-kendo-template">
    <div data-container-for="expires_at" class="k-edit-field">
        <input type="date" name="expires_at" data-bind="value:expires_at" data-role="datepicker"/>
    </div>
</script>


$('#grid').kendoGrid({
    dataSource: {
        data: [
            {
            name: 'test 1',
            expires_at: "2010-11-01T00:00:00Z"},
        {
            name: 'test 2',
            expires_at: "2012-04-25T00:00:00Z"}
        ],
        pageSize: 10
    },
    columns: [
        {
        field: "name",
        title: "Name",
        template: '<strong>#=name#</strong>'},
    {
        field: "expires_at",
        title: "Date",
        template: '#= kendo.toString(new Date(expires_at), "MM/dd/yyyy") #',
        width: "100px"},
    {
        command: ["edit"],
        title: "&nbsp;",
        width: "210px"}
    ],
    editable: {
        mode: "popup",
        template: kendo.template($('#templ').html(), {
            useWithBlock: false
        }),
        update: true,
        destroy: false
    }
});​


Maybe someone can point me in the right direction ...!?

thanks

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Philipp
Top achievements
Rank 1
Share this question
or