Pages

Friday, August 17, 2018

Sharepoint 2013 or Online Enter date picker in the data sheet view scrolls form to the top of the Page

When you create data sheet view with Date field and put in the Sharepoint Dash board page.

Users are trying to enter or change Date from Data Sheet view in the Chrome Browser.

Once User Clicked on the Date field, it will jump into the top of the page.

Users always facing difficult to enter Date field.

This is happening when using not -IE browsers.

If you use IE browser then there is no issue.

Find in the following work around code.

1. Open the Sharepoint Page.
2.Edit Page.
3.Add Script Editor web part and script tag begin and end.
4.Add the following code in the Script Editor.
5. Publish the page.

ExecuteOrDelayUntilScriptLoaded(
    function() {
        if (typeof(window.original_OnIframeLoadFinish) !== 'function') {
            window.original_OnIframeLoadFinish = window.OnIframeLoadFinish;
            window.OnIframeLoadFinish = function() {
                original_OnIframeLoadFinish.apply(this, arguments);
                window.Picker.contentWindow.original_setFocusDatepicker = window.Picker.contentWindow.setFocusDatepicker;

                window.Picker.contentWindow.setFocusDatepicker = function() {
                    workspaceTop = document.getElementById('s4-workspace').scrollTop;
                    window.Picker.contentWindow.original_setFocusDatepicker.apply(this, arguments);
                    document.getElementById('s4-workspace').scrollTop = workspaceTop;
                }
            }
        }
    }, "datepicker.js");

No comments:

Post a Comment