Skip to content

Commit aa88300

Browse files
author
Matt Mazzola
committed
Add scenario 6: update settings to demo application
1 parent 9503f67 commit aa88300

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

‎demo/app/app.js‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ $(function () {
4141
}
4242
]);
4343

44+
// Scenario 6: Update settings
45+
var $updateSettingsReport = $('#updatesettingsreport');
46+
var updateSettingsReport;
47+
var updateSettingsReportFilterPaneEnabled = false;
48+
var updateSettingsReprotNavContentPaneEnabled = false;
49+
var $toggleFilterPaneButton = $('#toggleFilterPane');
50+
var $toggleNavContentPaneButton = $('#toggleNavContentPane');
51+
52+
$toggleFilterPaneButton.on('click', function () {
53+
updateSettingsReportFilterPaneEnabled = !updateSettingsReportFilterPaneEnabled;
54+
updateSettingsReport.updateSettings({
55+
filterPaneEnabled: updateSettingsReportFilterPaneEnabled
56+
});
57+
});
58+
59+
$toggleNavContentPaneButton.on('click', function () {
60+
updateSettingsReprotNavContentPaneEnabled = !updateSettingsReprotNavContentPaneEnabled;
61+
updateSettingsReport.updateSettings({
62+
navContentPaneEnabled: updateSettingsReprotNavContentPaneEnabled
63+
});
64+
});
65+
4466
/**
4567
* This is temporarily hard code so we can load reports from the pre-production environment for testing out new features.
4668
*/
@@ -159,6 +181,18 @@ $(function () {
159181
});
160182
});
161183
});
184+
185+
/**
186+
* Update Settings
187+
*/
188+
var updateSettingsEmbedConfig = $.extend({
189+
settings: {
190+
filterPaneEnabled: updateSettingsReportFilterPaneEnabled,
191+
navContentPaneEnabled: updateSettingsReprotNavContentPaneEnabled
192+
}
193+
}, reportConfig);
194+
195+
updateSettingsReport = powerbi.embed($updateSettingsReport.get(0), updateSettingsEmbedConfig);
162196
});
163197
}
164198
});

‎demo/index.html‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,18 @@ <h5>Advanced Operators</h5>
291291
</div>
292292
</form>
293293

294-
</div>
295294
</div>
296295
</div>
297296

297+
<h2>Update Settings</h2>
298+
<p>Change visibility of filter pane or page navigation dynamically</p>
299+
300+
<div id="updatesettingsreport" class="powerbi-container"></div>
298301

302+
<div>
303+
<button type="button" class="btn btn-primary" id="toggleFilterPane">Toggle Filter Pane</button>
304+
<button type="button" class="btn btn-primary" id="toggleNavContentPane">Toggle Page Navigation</button>
305+
</div>
299306
</div>
300307

301308
<script src="bower_components/jquery/dist/jquery.js"></script>

0 commit comments

Comments
 (0)