form: datepicker, set calendar options

what do i have to do:
i want to set the calendar “dayTemplate” for a form element view: “date picker” .

did it for property sheet and datatable, but struggling on the form element. best would be to have a preconfigured new prototype

made it run by a new protoUI, but calendar Icon is missing then…
most easy would be, if you add the option to set a dayTemplate for calendar in the datepicker object by default…

hope for some help,
chris

webix.protoUI({
    name: "datepickerHoliday",
    _init_popup: function () {
        var obj = this._settings;
        if (obj.suggest)
            obj.popup = obj.suggest;
        else if (!obj.popup) {
            var timepicker = this._settings.timepicker;
            obj.popup = obj.suggest = this.suggest_setter({
                type: "calendar", height: 240 + (timepicker ? 30 : 0), width: 250, padding: 0,
                body: {timepicker: timepicker, type: this._settings.type, icons: this._settings.icons, dayTemplate: coco.dayTemplateWithHoliday }
            });
        }

        this._init_once = function () {
        };
    }
}, webix.ui.datepicker );

…but that snippet only works with webix_debug.js - so, please…
I NEED YOUR HELP.

:slight_smile:

I think you should not extend webix widget with private fields or method (which start with _ character)

i know that - was just a quick hack - but don’t now actually how to solve my problem.

Hi,

The easiest way is to define this property for the inner calendar using

datepicker.getPopup().getBody().define()

http://webix.com/snippet/8d6e05d2

As for ui.proto, you can definedayTemplate within theconfig.suggest. Perhaps, it would be useful to move it forward to the view config:

http://webix.com/snippet/219b663c

thx!