Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Mutation Observers to the rescue! See this demo:
Customize Datepicker ~ Add New Record
https://haversineconsulting.quickbase.com/db/bnt9q8afj?a=nwr
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=672
Notes:
(1) Mutation Observers is a JavaScript API that can detect changes to the DOM.
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
Instead of tracking down the internals of how QuickBase creates and initializes the jQueryUI Datepicker widget we can just wait till it becomes visible by setting up a Mutation Observers and test for attribute changes.
(2) The code in the pasties could be improved as it actually repeatedly changes the Datepicker's options to the same value for each attribute change.
(3) You can pick your own colors by modifying the colors in these two statements:
$("a.ui-state-default").css({background: "cyan"});
$("a.ui-state-active").css({background: "lime"});
(4) Mutation Observers can also be used to change the content and behavior of any Dialog QuickBase displays without having to track down and modify QuickBase's authored JavaScript.
(5) What a cool name - Mutation Observer! Set this up and tell your boss and users it was trivial to implement with a Mutation Observer and report their response here.
Customize Datepicker ~ Add New Record
https://haversineconsulting.quickbase.com/db/bnt9q8afj?a=nwr
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=672
Notes:
(1) Mutation Observers is a JavaScript API that can detect changes to the DOM.
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
Instead of tracking down the internals of how QuickBase creates and initializes the jQueryUI Datepicker widget we can just wait till it becomes visible by setting up a Mutation Observers and test for attribute changes.
(2) The code in the pasties could be improved as it actually repeatedly changes the Datepicker's options to the same value for each attribute change.
(3) You can pick your own colors by modifying the colors in these two statements:
$("a.ui-state-default").css({background: "cyan"});
$("a.ui-state-active").css({background: "lime"});
(4) Mutation Observers can also be used to change the content and behavior of any Dialog QuickBase displays without having to track down and modify QuickBase's authored JavaScript.
(5) What a cool name - Mutation Observer! Set this up and tell your boss and users it was trivial to implement with a Mutation Observer and report their response here.