Skip to content

Commit

Permalink
feat(filters): inclusion of the modal filter in example 7
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegario committed Dec 16, 2021
1 parent efb0189 commit 1ac2da9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions examples/webpack-demo-vanilla-bundle/src/examples/example07.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ export class Example7 {
const grid = this.sgb;
const modalHtml: string = `<div id="modal-allFilter" class="modal is-active" >
<style type="text/css">
.table {
display: table;
#modal-allFilter-table {
display: table;
}
.row {
#modal-allFilter-table .row {
display: table-row;
}
.column {
#modal-allFilter-table .column {
display: table-cell;
vertical-align: top;
width: 40%;
Expand All @@ -343,7 +343,7 @@ export class Example7 {
<section class="modal-card-body">
<div class="slickgrid-container grid-pane">
<div id="modal-allFilter-content">
<div id="modal-allFilter-table" class="table slick-headerrow ui-state-default">
<div id="modal-allFilter-table" class="slick-headerrow ui-state-default">
</div>
</div>
</div>
Expand All @@ -359,11 +359,12 @@ export class Example7 {
document.body.appendChild(DOMPurify.sanitize(modalHtml, { RETURN_DOM: true }));

$(".btn-close").on('click', function () {
grid?.filterService.toggleHeaderFilterRow();
if (grid?.slickGrid.getOptions().showHeaderRow) {
grid?.showHeaderRow(true);
}
document.getElementById("modal-allFilter").remove();
});
$("#btn-clear-all").on('click', function () {
grid?.filterService.toggleHeaderFilterRow();
document.getElementById("modal-allFilter").remove();
grid?.filterService.clearFilters();
});
Expand All @@ -379,9 +380,6 @@ export class Example7 {
grid?.filterService.drawFilterTemplate(columnFilter, `#${filterElm}`);
}
}
if (grid?.slickGrid.getOptions().showHeaderRow) {
grid?.filterService.toggleHeaderFilterRow();
}

}

Expand Down

0 comments on commit 1ac2da9

Please sign in to comment.