JSP kendo ui自定义模板

时间:2014-09-07 10:22:59

标签: jsp kendo-ui kendo-scheduler

我正在尝试创建调度程序自定义事件。我尝试过很多东西,但它不起作用我怎样才能为jsp创建自己的模板?还有另外一个问题。已知道一些用于创建自定义模板并将其附加到其他对象的对象。

    <kendo:scheduler allDayEventTemplate="event-template" name="scheduler" timezone="Etc/UTC" height="550" date="<%= date %>" startTime="<%= startTime %>">
    <kendo:scheduler-views>
        <kendo:scheduler-view type="day" />
        <kendo:scheduler-view type="workWeek" selected="true" />
        <kendo:scheduler-view type="week" />
        <kendo:scheduler-view type="month"  />
        <kendo:scheduler-view type="agenda" />
    </kendo:scheduler-views>
     <kendo:scheduler-editable>
     </kendo:scheduler-editable>
    <kendo:dataSource batch="true">
        <kendo:dataSource-filter>
            <kendo:dataSource-filterItem logic="or">
                <kendo:dataSource-filterItem field="ownerId" operator="eq" value="1" />
                <kendo:dataSource-filterItem field="ownerId" operator="eq" value="2" />
            </kendo:dataSource-filterItem>
        </kendo:dataSource-filter>
         <kendo:dataSource-schema>
            <kendo:dataSource-schema-model id="vacationId">
                 <kendo:dataSource-schema-model-fields>
                     <kendo:dataSource-schema-model-field name="subject" type="number" defaultValue="No title" />
                     <kendo:dataSource-schema-model-field name="dayOfGo"  type="date" />
                     <kendo:dataSource-schema-model-field name="hour" type="integer" />
                     <kendo:dataSource-schema-model-field name="requestStatus" type="string"/>
                     <kendo:dataSource-schema-model-field name="body" type="string" />
                     <kendo:dataSource-schema-model-field name="name" type="string"/>
                 </kendo:dataSource-schema-model-fields>
            </kendo:dataSource-schema-model>
        </kendo:dataSource-schema>
        <kendo:dataSource-transport>
            <kendo:dataSource-transport-create url="${createUrl}" dataType="json" type="POST" contentType="application/json" />
            <kendo:dataSource-transport-read url="${readUrl}" dataType="json" type="POST" contentType="application/json" />
            <kendo:dataSource-transport-update url="${updateUrl}" dataType="json" type="POST" contentType="application/json" />
            <kendo:dataSource-transport-destroy url="${destroyUrl}" dataType="json" type="POST" contentType="application/json" />
            <kendo:dataSource-transport-parameterMap>
                <script>
                    function parameterMap(options, type) { 
                        if(type==="read"){
                            return JSON.stringify(options);
                        } else {
                            return JSON.stringify(options.models);
                        }
                    }
                </script>
            </kendo:dataSource-transport-parameterMap>              
        </kendo:dataSource-transport>
    </kendo:dataSource>
</kendo:scheduler>

<script>
    $("#people :checkbox").change(function(e) {
        var checked = $.map($("#people :checked"), function(checkbox) {
            return parseInt($(checkbox).val());
        });

        var filter = {
            logic: "or",
            filters: $.map(checked, function(value) {
                return {
                    operator: "eq",
                    field: "ownerId",
                    value: value
                };
            })
        };

        var scheduler = $("#scheduler").data("kendoScheduler");

        scheduler.dataSource.filter(filter);
    });
</script>
<script id="event-template" type="text/x-kendo-template">
     <div class='movie-template'>
        <p>H</p> 
    </div>
</script>

0 个答案:

没有答案