Modal window display all filters for all fields (including hidden fields) #512
Replies: 1 comment 1 reply
-
There is no method for that, there's other similar thing that might help you or give you idea but there is nothing exactly like you want.
I think the biggest problem you'll encounter is that all Filters are created as DOM elements and then inserted into the Header Row and that target is encoded into every Filter for example if we take the slickgrid-universal/packages/common/src/filters/inputFilter.ts Lines 215 to 216 in a8755c0 I think what you want to do is doable but you'll have to modify each Filters, you could maybe add an extra option into ColumnFilter interface, something like this.columnDefinitions = [
{
id: 'firstName', field: 'firstName',
filter: {
model: Filters.input,
container: document.querySelector('#modal-body'),
}
}
]; and in each Filters, something like this let filterContainer;
if (this.columnFilter?.container) {
filterContainer = typeof this.columnFilter.container === 'string' ? document.querySelect(this.columnFilter.container) : this.columnFilter.container; // accept a query selector string or an html element
} else {
filterContainer = this.grid.getHeaderRowColumn(columnId);
emptyElement(filterContainer);
}
// append the new DOM element to the header row & an empty span
filterContainer.appendChild(inputElm);
filterContainer.appendChild(document.createElement('span')); For adding this code, you have 2 options I wouldn't mind getting contribution on this, so if you want to go for option 1) then great, it's up to you. On another note, I did add a Modal component (like Example 12) for the Composite Editor Modal but I don't really want to add another modal for this one here though, I think you can create your own modal window and just target its modal body content as The Composite Editor Modal work in a similar fashion, it loops through all column definitions to build its list of Editors in the modal, I also added the property disabled in the So there's a lot of info here, it should get you started, have fun and feel free to contribute 😉 |
Beta Was this translation helpful? Give feedback.
-
@ghiscoding
Hello
I need to create a modal window that displays all filters for all fields, I couldn't find any method in the API that returns the html elements of the filters.
Could you give me some hint on how I can get these html elements from the API and redirect to my modal window.
Type like this: a method that returns all html elements from filters from all fields (including hidden fields) into an array.
See example image below.
Att.
Marcos Callegario
Beta Was this translation helpful? Give feedback.
All reactions