Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onInitialized is not totally initialized #1281

Open
FVZGmbH opened this issue Aug 8, 2024 · 0 comments
Open

onInitialized is not totally initialized #1281

FVZGmbH opened this issue Aug 8, 2024 · 0 comments

Comments

@FVZGmbH
Copy link

FVZGmbH commented Aug 8, 2024

I try to point the filter of the multiselect to add some stuff. But as it seems the child nodes are not in DOM at this time.
I use a specific template for the filter.

jQuery('select[multiple="multiple"]').multiselect({
		buttonWidth: '300px',
		enableCaseInsensitiveFiltering: true,
		filterPlaceholder: 'Filtern...',
		includeSelectAllOption: true,
		selectAllJustVisible: true,
		buttonTextAlignment: 'start',
		selectAllText: 'Alle auswählen',
		allSelectedText: 'Alle ausgewählt',
		nonSelectedText: 'Auswählen',
		nSelectedText: ' ausgewählt',
		buttonClass:' form-select text-start',
		templates: {
			filter: '<div class="multiselect-filter d-flex align-items-center"><i class="fas fa-sm fa-search text-muted"></i><input type="search" class="multiselect-search form-control" data-selectAllText-original="Alle auswählen"  data-selectAllText-filtered="Alle gefilterten auswählen" /></div>'
		},
		onInitialized: function(select, container) {
			console.log(container.children('.multiselect-container').children().length) // result: 0, should be count of select->options plus 1 (the filter tag) 
	}
});

I can't find any solution to wait till everything is in place to alter some things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant