简体   繁体   中英

Web embedded Excel spreadsheet does not work properly on mobile devices

I am trying to use OneDrive Excel Spreadsheet on my Wordpress website. So far it works good if someone accesses it via Desktop's internet browsers, but it does not work properly on mobile devices.

As I could find the problem is that provided microsoft javascript puts spreadsheet's cells in "div" tags. Mobile internet explores do not recognize these divs as something for data entering and because of it do not call keyboard, so user cannot enter data.

Can I do something using Javascript or other method to change these divs to other html tags that will call mobile keyboard?

Please refer to this code snippet from microsoft OneDrive

<div id="myExcelDiv" style="width: 200px; height: 250px"></div>
<script type="text/javascript" src="http://r.office.microsoft.com/r/rlidExcelWLJS?v=1&kip=1"></script>
<script type="text/javascript">

var fileToken = "SDD03D60E1D5E574B7!119/-3441488017168698185/t=0&s=0&v=!ACF_FBbpHVUZBh8";

// run the Excel load handler on page load
if (window.attachEvent) {
    window.attachEvent("onload", loadEwaOnPageLoad);
} else {
    window.addEventListener("DOMContentLoaded", loadEwaOnPageLoad, false);
}

function loadEwaOnPageLoad() {
    var props = {
        item: "'Sheet1'!C4:D14",
        uiOptions: {
            showDownloadButton: false,
            showGridlines: false,
            showParametersTaskPane: false
        },
        interactivityOptions: {
            allowParameterModification: false,
            allowSorting: false,
            allowFiltering: false,
            allowPivotTableInteractivity: false
        }
    };

    Ewa.EwaControl.loadEwaAsync(fileToken, "myExcelDiv", props, onEwaLoaded);
}

function onEwaLoaded(result) {
    /*
     * Add code here to interact with the embedded Excel web app.
     * Find out more at http://msdn.microsoft.com/en-US/library/hh315812.aspx.
     */
}
</script>

The Office Web Apps act only as viewers on phone-type devices. You'll see that for smartphone devices, only "viewer" scenarios are listed for the Office Web Apps . For tablets and desktop computers, they have the full view/edit capabilities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM