<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PowerBI Javascript API switchMode in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/403231#M12030</link>
    <description>&lt;P&gt;Thanks Michael.&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment-copy"&gt;This works. The current TypeScript definitions require a models.ViewMode enum value, but if I bypass the TypeScript def and pass in a string as you suggest it works. Looks like the library just needs to be updated so that it sends the string value instead of the numeric value of the enum.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 12:06:54 GMT</pubDate>
    <dc:creator>sccrgoalie1</dc:creator>
    <dc:date>2018-04-24T12:06:54Z</dc:date>
    <item>
      <title>PowerBI Javascript API switchMode</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/401051#M11956</link>
      <description>&lt;P&gt;I'm working with the latest release (2.5.0) of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript" target="_blank" rel="nofollow noreferrer"&gt;PowerBI JavaScript API&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and am not able to get the report.switchMode method to succeed. An error is always returned with invalid view mode.&lt;/P&gt;&lt;P&gt;I'm calling this after the this.report has been initialized. I've tried sending in a string for the view mode, to see if it worked like that, but that did not work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;this.report.switchModel(models.ViewMode.Edit)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;In debugging, I can see it's making the following call but I can't figure out what is an acceptable view mode parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'/report/switchMode/' + models.ViewMode.Edit&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:52:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/401051#M11956</guid>
      <dc:creator>sccrgoalie1</dc:creator>
      <dc:date>2018-04-20T13:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Javascript API switchMode</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/401816#M11985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please take a try with the way below:&lt;/P&gt;&lt;P&gt;You can use the following JavaScript to switch into view mode, if you are in edit mode&lt;/P&gt;&lt;PRE&gt;```javascript
// Switch to view mode.
report.switchMode("view");
```&lt;/PRE&gt;&lt;P&gt;You can use the following JavaScript to switch into edit mode, if you are in view mode&lt;/P&gt;&lt;PRE&gt;```javascript
// Switch to edit mode.
report.switchMode("edit");
```&lt;/PRE&gt;&lt;P&gt;For more configuration code, check:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details" target="_self"&gt;Embed Configuration Details&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 03:09:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/401816#M11985</guid>
      <dc:creator>v-micsh-msft</dc:creator>
      <dc:date>2018-04-23T03:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Javascript API switchMode</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/403231#M12030</link>
      <description>&lt;P&gt;Thanks Michael.&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment-copy"&gt;This works. The current TypeScript definitions require a models.ViewMode enum value, but if I bypass the TypeScript def and pass in a string as you suggest it works. Looks like the library just needs to be updated so that it sends the string value instead of the numeric value of the enum.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 12:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Javascript-API-switchMode/m-p/403231#M12030</guid>
      <dc:creator>sccrgoalie1</dc:creator>
      <dc:date>2018-04-24T12:06:54Z</dc:date>
    </item>
  </channel>
</rss>

