This is a migrated thread and some comments may be shown as answers.

Resize Searchbox

2 Answers 79 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Mickael
Top achievements
Rank 1
Mickael asked on 23 Mar 2016, 12:53 PM

How can I resize the SearchBox from javascript ?

I want to resize the SearchBox based on some available width between a min and max value I provide.

I tried the following but nothing changed

searchBox._dropDownWidth = "100px";
searchBox._element.clientWidth = "100px";

2 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 24 Mar 2016, 09:34 AM
Hello Mickael,

You could re-size the RadSearchBox on the client by manipulating the DOM elements using jQuery. Possible implementation could be:
// Find the RadSearchBox DOM element as a jQuery object
var searchBox = $telerik.$('#searchBox');
var input = $telerik.$(searchBox.find('.rsbInput'));
// Make the input wider
input.css('width', '423px');
// Make the whole RadSearchBox wider
searchBox.css('width', '500px');

Regards,
Veselin Tsvetanov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Mickael
Top achievements
Rank 1
answered on 24 Mar 2016, 12:28 PM

Works perfectly.

Thank you very much :)

Tags
SearchBox
Asked by
Mickael
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Mickael
Top achievements
Rank 1
Share this question
or