data-size does not work
See original GitHub issueI have an issue while using the plugin. My problem is that when I am searching for items and there are big amount of results , vertical scrolls are not appearing. I have data-size set to 10 and it works only after I close and reopen the drop down list. Please help.
`
$('#ddlLocation')
.selectpicker({
})
.ajaxSelectPicker({
ajax: {
url: '@(Url.RouteUrl("Search"))',
type: "POST",
dataType: "json",
data: function () {
var params = {
Filter: '{{{q}}}',
CountryName: 'USA'
};
return params;
}
},
locale: {
emptyTitle: 'Search for Location...'
},
preprocessData: function (data) {
var i, l = data.length,
arr = [];
if (l) {
for (i = 0; i < l; i++) {
if (data[i].Location.toLowerCase().indexOf(this.plugin.query) != -1 || data[i].Location.toLowerCase().indexOf(this.plugin.query) != -1) {
arr.push($.extend(true, data[i], {
text: data[i].Location,
value: data[i].ID,
disabled: false
}));
}
}
}
return arr;
},
preserveSelected: false,`
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Spring DataSize class not found
Problem is mismatching Spring Boot (2.1.8.RELEASE) and Spring Core (5.0.12) versions. Core is 5.0.12, because it is transitive dependency of ...
Read more >configprops endpoint does not display DataSize properties ...
configprops endpoint does not display DataSize properties ... It looks like there is also a problem with inputs as the output above was ......
Read more >[SERVER-58358] Datasize command does not validate the ...
the command is still executed on the entire collection, so there is no validation of what the user was really intending to do,...
Read more >DataSize (Spring Framework 6.0.3 API)
This class models data size in terms of bytes and is immutable and thread-safe. ... as 12MB using the specified default DataUnit if...
Read more >db.collection.dataSize()
Returns: The size in bytes of the collection. Data compression does not affect this value. Starting in MongoDB 4.4, to run ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
if fixed it by adding a setTimeout:
The issue is here in
bootstrap-select
: https://github.com/silviomoreto/bootstrap-select/blob/v1.12.2/js/bootstrap-select.js#L1012with this part of the code:
this.$lis.not(notDisabled).length > this.options.size
If using the
size
option and populating the options AFTER the initialization (e.g. using AJAX) the dropdown’s max height won’t be set and it will have no max height becausethis.$lis.not(notDisabled).length > this.options.size
isfalse
at that time asthis.$lis.not(notDisabled).length
will be 0 and it’s greater thanthis.options.size
.So this part won’t run at all:
https://github.com/silviomoreto/bootstrap-select/blob/v1.12.2/js/bootstrap-select.js#L1028