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

EnableFilteringOnEnterPressed In Firefox Possible Bug

1 Answer 16 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Paul Herzberg
Top achievements
Rank 1
Paul Herzberg asked on 05 Jun 2013, 02:02 PM
Hello,

If I choose the following for RadfileExplorer:

 EnableFilterTextBox="true" EnableFilteringOnEnterPressed="true"

When I go straight to the text box and enter a term, the "Back" button gets focus and nothing else seems to happen, but only in Firefox. IE10 works as you would expect.

If it helps here is some background. The company I work for is using the Fileexplorer as part of an editting tool. The Fileexplorer allows our users access to files that they have uploaded to the companies CMS system.

I have created a Filesystemprovider that gives access to files depending on the user and where they are accessing the editting tool.

I have extended this provider to have information about the default "alternative text" for images and store this in the FileItem.Path variable as a csv variable. The path looks like this:

Uploads/2350|0|0|ALTDESC|1|15.01.2013 16:49:47|0

I've bolded the information I want to using in the filter.

The whole thing breaks down like this: virtual path / fileid | height | width | alt description | boolval| upload date | boolval

So, in order to filter with this extra field I have to catch the filter command and then do a postback of my own, because the FilterText value is inaccessable in the code behind I have to put this in a hidden field, this I do like so:

function explorerFilterHandler(explorer, args)
{
        args.set_cancel(true);
	hField = $get("<%= explorersFilterValue.ClientID%>");
	hField.value = args.get_text();
	__doPostBack(hField.name, "");
}

As per another forum post.

Because the filter text is deleted on postback I have to refill the text box and then set the cursor to the end of the text once the OnClientLoad of the FileExplorer is fired (Onclientload = "setFilter"):


         function setFilter(){   
            var hField  = $get("<%= explorersFilterValue.ClientID%>");
            if(hField.value != ''){
                var filter = $('input[id$="FilterTextBox"]');
                filter.val(hField.value);
                filter.focus()
                setSelectionRange(filter[0], hField.value.length, hField.value.length);
            }
        }
 
        function setSelectionRange(input, selectionStart, selectionEnd) {
            if (input.setSelectionRange) {
                input.focus();
                input.setSelectionRange(selectionStart, selectionEnd);
            }
            else if (input.createTextRange) {
                var range = input.createTextRange();
                range.collapse(true);
                range.moveEnd('character', selectionEnd);
                range.moveStart('character', selectionStart);
                range.select();
            }
        }

Because this postback can be slower than a typist can put in the letters this can mean text disappears if the user is not careful, so it was decided the use the EnableFilteringOnEnterPressed setting.

I thought that, perhaps, the error could have been caused by all this extra work, but it seems when I add a simple FileExplorer to a different page, the same thing happens.

It may simply be that I have missed something.

Thank you for your help in this matter.

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 10 Jun 2013, 01:53 PM
Hi Paul,

Thank you for bringing this issue to our attention.

I managed to reproduce it on our side and I have logged it into our bug - tracking system. Unfortunately I am not able to provide any suitable workaround for the moment.

As a small token of gratitude for your report I have updated your Telerik points.

Regards,
Veselina Raykova
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
FileExplorer
Asked by
Paul Herzberg
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or