none
Bug/Feature? Using JavaScript API for Office to update table does not update derived charts on separate sheets RRS feed

  • Question

  • if only there were an equivalent of jsFiddle for this type of thing ;-)

    I have a simple prototype taskpane app for Office (2013). User interaction on the taskpane causes a table/sheet to be updated. While the table's sheet is selected, invoking updates, updates the table data immediately.

    If I add a new (blank) sheet, switch to it and invoke the same updates operation, clicking back to the sheet containing the table shows the data correctly updated.

    If I add a chart to the sheet with the table data, invoking the update, updates the data and - of course - the graph. If cut-and-paste the chart to another (existing) sheet, works too.

    However, if I then move the chart to a new sheet so that it represents the entire sheet, invoking the update while the chart is selected does *not* update the table data.

    I'm using TableBinding.addRowsAsync and, in the non-updating case, the asyncResult is "Failed".

    For all others cases, it is "Succeeded".

    It's not obvious to me why this case would/should be different.

    Wednesday, October 3, 2012 9:44 PM

Answers

  • hello! this is a great question, thanks for asking.. This is definetly a bug on the build you are using, i tried exactly the same scenario with the latest build and I could:

    1. bind to a table

    2. add rows

    3. add a new sheet, keep adding rows (works!)

    4. Added a chart bound to the bound table and add rows (works!)

    5. moving the bound chart to a new Sheet , add rows (worked!)

    Please bear with us and try the scenario again when the RTM build becomes available!

    Success!!!

    -Juan.


    Thursday, October 4, 2012 6:42 PM
    Moderator

All replies

  • hello! this is a great question, thanks for asking.. This is definetly a bug on the build you are using, i tried exactly the same scenario with the latest build and I could:

    1. bind to a table

    2. add rows

    3. add a new sheet, keep adding rows (works!)

    4. Added a chart bound to the bound table and add rows (works!)

    5. moving the bound chart to a new Sheet , add rows (worked!)

    Please bear with us and try the scenario again when the RTM build becomes available!

    Success!!!

    -Juan.


    Thursday, October 4, 2012 6:42 PM
    Moderator
  • Thanks Juan!

    By the way, I'm using "az88874.vo.msecnd.net" as the host to office.js after this was provided when I followed a "hello world" tutorial online. I note that Visual Studio 2012's Office templates install the library locally.

    I assume Microsoft plans to offer office.js via the CDN at some point but, meantime, is it okay/good to reference the msecnd.net version? Is this guaranteed to be current?

    Thursday, October 4, 2012 7:54 PM
  • Yes, actually az88874.vo.msecnd.net is our temporal CDN location for the preview release. This is going to change very soon to a more friendly-named  and robust location, we are going to ask everyone to move to the new location once its ready.  Keep an eye on our blog and forums, we'll publish this information when this is ready.

    And YEs VS installs a verison of the Office.js locally (to enable offline development), on the latest version VS will validate (when creating/publishing your app) that you are getting Office.js from the final CDN location.

    On top of that,  Office.js is going to be exposed as a nuget package inside VS so that you can update the it when a new version becomes available in the CDN, in a standarized-nuget way :).

    Finally, I just want to clarify that the chart error I was referrinf to the version of the Office client (I assume you are using the preview?) you are using, and not the javascript API.

    Have fun creating apps!!!

    -Juan.


    Thursday, October 4, 2012 8:04 PM
    Moderator
  • Hi guys,

    Iam trying to create charts like simple bar,pie charts in content pane(office apps).

    Please let me know how to create charts in content pane with javascript API for office itself.

    - Meera

    Thursday, October 18, 2012 9:21 AM
  • Hello Meera...you can definetly do this! we dont have a chart library in Office.js, but we dont need it! thats the beauty of the model you can use the existing web tools to create your chart. I encourage you to use HTML5 and Javascript for this. there are also a few charting libraries out there that you can probably reuse. thanks!


    Thursday, October 18, 2012 12:26 PM
    Moderator
  • M3ra

    I've used jqPlot successfully in other projects and recommend it

    Thursday, October 18, 2012 12:54 PM