Last active
January 18, 2018 16:35
-
-
Save azampagl/54e2f12952c77f90518df68fc42906cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '@xbs/webix-pro'; | |
import '@xbs/scheduler'; | |
/** | |
* | |
*/ | |
export class Mobile extends ComponentCore { | |
// | |
scheduler: any = null; | |
// ... a bunch of other functions ... | |
/** | |
* | |
*/ | |
init() { | |
// I see the global scheduler and templates in the global window | |
// but when using web.ui to initialize a scheduler it never takes this function into account. | |
(window as any).scheduler.templates.event_marker = function (obj: any, type: any) { | |
var style = ""; | |
console.log(obj); | |
if (obj.color) { | |
console.log(obj.color); | |
var rgb = webix.color.toRgb(obj.color); | |
style += ";border-color:" + obj.color + ";"; | |
style += "background-color:rgba(" + rgb.toString() + ",0.9);"; | |
} | |
return "<div class='webix_event_marker'><div style='" + style + "'></div></div>"; | |
}; | |
webix.ready(async () => { | |
this.scheduler = webix.ui({ | |
view: "scheduler", | |
id: this.id, | |
data: [] | |
}, $(`#${this.id}`)); | |
// initialization stuff | |
// ** this.scheduler NEVER CALLS ANY OF THE PRE-DEFINED TEMPLATE FUNCTION ** | |
}); | |
} | |
} | |
// | |
export default Mobile; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment