5
votes

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 explorers do not recognize these divs as something for data entering and because of it do not call keyboard, so the user cannot enter data.

Can I do something using Javascript or other methods 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>
1
If the javascript is right then the div tags should be recognised by the mobile browser. You may have a javascript error that's happening on mobile. Have you run in safari on desktop to make sure it works in Safari? - Toby Allen
I am sorry my question is not about explorers do not recognize div tags but about mobile explorer do not display device's keyboard to enter values in the cells of embedded spreadsheet - SaidAkh
@Said have you tried using jquery mobile keyboard? or jquery4u.com/demos/onscreenkeyboard. You may need to detect cells onclick or something. Then show the keyboard. - RGAT

1 Answers

0
votes

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.