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

"Show all results" event

5 Answers 92 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Petr
Top achievements
Rank 1
Iron
Petr asked on 25 Nov 2016, 05:27 PM

Dear all,

I implement function which open the list after click in the control:

var $ = $telerik.$;
function pageLoad() {
    $(".racTokenList").on("click", function (e) {
        var controlId = this.parentElement.id;
        var autoComplete = $find(controlId);
        autoComplete.query(" ");
    })
}

 

But there is a problem with "Show All Results" button. If I click on it, it gets the value from control which is empty nothing is shown. Is there any event when user invoke this function?

I don't want to put empty space in input field, because if user start typing then it will include the space.

Thank you for any ideas,

Petr

5 Answers, 1 is accepted

Sort by
0
Petr
Top achievements
Rank 1
Iron
answered on 28 Nov 2016, 02:01 PM

In the meantime I found the solution. I put space in input and select it. So button works fine and if user start typing it removes this blank character. The only problem is that after button is pressed, the selection is gone. If user types anything space is there and it is not filtered correctly, but I can live with it. My new code is:

function pageLoad() {
            $telerik.$(".racTokenList").on("click", function (e) {
                var controlId = this.parentElement.id;
                var autoComplete = $find(controlId);
                autoComplete.get_inputElement().value = " ";
                autoComplete.get_inputElement().select();
                autoComplete.query(" ");
            })

 

The other problem I have is problem with drop down list. I use this control in edit dialog for RadGrid. But if I open drop down list and move the dialog then list stays on the same position. After closing dialog it is still visible. I think that correct behaviour is like combobox so list is closed after moving or hidding parent input. Is there any property for it?

Thanks,

Petr

0
Ivan Danchev
Telerik team
answered on 28 Nov 2016, 03:50 PM
Hello Petr,

We are glad you have found a way to customize the behavior of the AutoCompleteBox. As for the the issue with the dropdown remaining open I checked the behavior of the RadComboBox and RadDropDownList in the Grid's popup editor in version 2016.3.1027 and their dropdowns close immediately after clicking anywhere on the window, so for example clicking on the window's header in order to drag it or clicking on its close button removes the focus from the RadComboBox or RadDropDownList and the dropdown closes automatically. This is their behavior by design.
Please, check which particular control you are using, whether it is a RadDropDownList, RadComboBox, asp:DropDownList, etc. and open a new thread about the issue you are experiencing with product RadGrid in case the behavior is specifically related to using the control in RadGrid, providing as much details as possible on your scenario and controls configuration. It would be helpful if you could isolate the issue in a sample project as explained in our blog post, as this would help us with reproducing it.
We try to keep the threads consistent with their original subject. This makes them more maintainable, easier to track and facilitates finding the relevant information they contain. 

Regards,
Ivan Danchev
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
0
Petr
Top achievements
Rank 1
Iron
answered on 28 Nov 2016, 04:55 PM

Hello Ivan,

Sorry for misunderstanding. The problem I have is with a list of matched results for RadAutoCompleteBox.There is general problem with resizing I think. I made simple page with RadAutoCompleteBox, type any text which open the list and resize the page. After that the list of results is not aligned with input box. In dialog you can move the dialog and position of list doesn't change and you can also close and it is still visible.

Unfortunately I was not able to find any event of RadAutoCompleteBox which is invoked when dialog is closing.

Regards,

Petr

0
Accepted
Ivan Danchev
Telerik team
answered on 30 Nov 2016, 03:18 PM
Hello Petr,

We noticed that the AutoCompleBox' dropdown behaves differently than the ComboBox and DropDownList's ones when the control is nested in a RadWindow or in the Grid's Edit window. On clicking the window to move it: the AutoCompleBox dropdown does not close automatically (video). Is this the behavior you are experiencing? As for the dropdown remaining open when closing the dialog window, does your scenario involve a postback occurring when closing the dialog? If so are there any js exceptions thrown when closing it? 

Regards,
Ivan Danchev
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
0
Petr
Top achievements
Rank 1
Iron
answered on 30 Nov 2016, 05:04 PM

Ivan,

Yes, it is exactly what I noticed. Yes, you are right postback solve my problem.

Thank you for your help,

Petr

Tags
AutoCompleteBox
Asked by
Petr
Top achievements
Rank 1
Iron
Answers by
Petr
Top achievements
Rank 1
Iron
Ivan Danchev
Telerik team
Share this question
or