Skip to content

Commit

Permalink
Fix: Styles which used multiple classes on the "Add condition" button…
Browse files Browse the repository at this point in the history
… (e.g. Bootstrap 4) wouldn't launch the builder immediately in a button collection.

https://datatables.net/forums/discussion/71515/show-searchbuilder-form#latest
  • Loading branch information
AllanJard committed Feb 4, 2022
1 parent d313e90 commit fcc6f2f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/index.ts
Expand Up @@ -97,12 +97,15 @@ import SearchBuilder, {setJQuery as searchBuilderJQuery} from './searchBuilder';
align: 'container',
span: 'container'
});

let topGroup = config._searchBuilder.s.topGroup;

// Need to redraw the contents to calculate the correct positions for the elements
if (config._searchBuilder.s.topGroup !== undefined) {
config._searchBuilder.s.topGroup.dom.container.trigger('dtsb-redrawContents');
if (topGroup !== undefined) {
topGroup.dom.container.trigger('dtsb-redrawContents');
}
if (config._searchBuilder.s.topGroup.s.criteria.length === 0) {
$('.'+($.fn as any).dataTable.Group.classes.add).click();
if (topGroup.s.criteria.length === 0) {
$('.'+($.fn as any).dataTable.Group.classes.add.replace(/ /g, '.')).click();
}
},
config: {},
Expand Down

0 comments on commit fcc6f2f

Please sign in to comment.