Forum Discussion
MarioZagreb
Mar 22, 2024Brass Contributor
jQuery datepicker on site page
Hello, I have 2 site pages (page1.aspx and page2.aspx). Both have different customized (with SPfx) web parts on them and both have jQuery UI datepickers. And they work if you open them directly thro...
MarioZagreb
Mar 22, 2024Brass Contributor
Ok, I found the solution in this thread:
https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-online-webparts-not-loading-correctly-until-page/m-p/2908602
protected async onInit(): Promise<void> {
await super.onInit();
navterm = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1);
((history) => {
var pushState = history.pushState;
history.pushState = (state, key, path) => {
pushState.apply(history, [state, key, path]);
this._onUrlChange();
};
})(window.history);
window.addEventListener('popstate', function (e) {
// Currently browsing by the browser history buttons ( back / forward )
// doesn't cause any effect on a sp conditionally loaded page.
// this._onUrlChange();
});
https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-online-webparts-not-loading-correctly-until-page/m-p/2908602
protected async onInit(): Promise<void> {
await super.onInit();
navterm = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1);
((history) => {
var pushState = history.pushState;
history.pushState = (state, key, path) => {
pushState.apply(history, [state, key, path]);
this._onUrlChange();
};
})(window.history);
window.addEventListener('popstate', function (e) {
// Currently browsing by the browser history buttons ( back / forward )
// doesn't cause any effect on a sp conditionally loaded page.
// this._onUrlChange();
});