Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
112
rated 0 times [  115] [ 3]  / answers: 1 / hits: 56743  / 8 Years ago, thu, september 22, 2016, 12:00:00

I have a selectpicker (bootstrap) in my page which options are loading dyanmically. It has a large number of list but not good to see. I want to reduce the height of the selectpicker. I have give inline style and all but it is not reflecting.



this is my code



<select class=selectpicker data-dropup-auto=false id=estType name=estType>
<option selected disabled value=0>Select</option>'
</select>


My js code



$function ({
$.ajax({
datatype: json,
type: GET,
async: false,
url: Establishment/GetPrePopulationDetails,
success: function (result, success) {
var esttypes = $.map(result['EstablishmentTypes'],
function (key, value) {
return $('<option>', { value: value, text: key });
});
$('#estType').append(esttypes);
},
error: function (xhr, ajaxOptions, thrownError) {
console.error(xhr.status);
console.error(thrownError);
}
});
});

More From » jquery

 Answers
30

I corrected it by myself...



Just add data-size in the html



<select class=selectpicker data-dropup-auto=false data-size=5 id=estType name=estType>
<option selected disabled value=0>Select</option>'
</select>

[#60642] Tuesday, September 20, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dayana

Total Points: 302
Total Questions: 102
Total Answers: 100

Location: Cayman Islands
Member since Fri, Mar 4, 2022
2 Years ago
;