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

Return footer text from web service

2 Answers 29 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 11 May 2015, 08:35 PM

I would like to fill in some custom footer information after search results are returned from a web service.  In the RadComboBox it was as easy as setting the RadcomboBoxData.Message property - how does one go about doing it for a SearchBox?  I would like to display either the number of items found + total search time, or a message saying "Please enter 3 characters to search".  

One possible solution is to return only 1 item with the message to display, and a null value; then upon client items requesting has ended look through the results in javascript, remove it if it fits the critieria and set the footer - but I don't even see any client events for when the search results are received.

Thank you in advance,
John

2 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 14 May 2015, 04:19 PM
Hello John,

Since RadSearchBox does not have a collection of the returned entries and a client-side method to access them, if you want to get their count you will have to use custom logic. For instance, the following code gets (on key up in the input field) the count of the "rsbListItem" elements the entries are rendered as:
$(document).ready(function () {
    $("#RadSearchBox1_Input").keyup(function () {
        setTimeout(function () {
            var returnedCount = $(".rsbListItem").length;
            alert(returnedCount);
        }, 500);
    });
});

Regards,
Ivan Danchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
John
Top achievements
Rank 1
answered on 14 May 2015, 04:40 PM

Thank you.  I see I would have to "guess" at the duration of the web service call....   At this time that's probably not the best fit.  I am going to stick with a RadDropdownBox...  Hopefully Telerik will enhance the search box UI experience to include things like this.

Thank you for your assistance,
John

Tags
SearchBox
Asked by
John
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
John
Top achievements
Rank 1
Share this question
or