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

first file always selected item

2 Answers 54 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ryan Fligg
Top achievements
Rank 1
Ryan Fligg asked on 16 Apr 2010, 09:42 PM
We're having a problem with the RadFileExplorer.OnClientItemSelected javascript method.  The method always gets the data for the first file item instead of the selected one.  Here is the javascript:

            function OnClientItemSelected(sender, args)
            {
               if (args.get_item().get_type() == Telerik.Web.UI.FileExplorerItemType.File)
               {
                   // if the item is a file
                   var file = ""File path : "" + args.get_item().get_path() + ""\n"";
                   file = file + ""File size : "" + args.get_item().get_size();
                   var label = $get(""" + labelClientID + @""");
                   label.innerText = file;
                   alert(""Selected file: \n"" + file);
               }
               else
               {// folder
                   alert(""The selected item is a directory"");
               }
               alert(""OnClientItemSelected : "" + (args instanceof Telerik.Web.UI.RadFileExplorerEventArgs).toString());
            }

So it seems that the args.get_item() is always selecting the first file item.  How do we fix this?  I've also attached a screenshot.  You can see the info in the label is for the first file instead of the selected one.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 21 Apr 2010, 03:55 PM
Hi Ryan,

I tried to reproduce the problem using the provided code but to no avail. Could you please open a support ticket and attach a sample runnable project that reproduces the problem so we can investigate it further?

Could you please find the movie demonstrating my test and see if I am doing something wrong?

Greetings,
Dobromir
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Ryan Fligg
Top achievements
Rank 1
answered on 21 Apr 2010, 05:39 PM
hi, first, sorry about the extra posts on this, the forum was saying there was an error when I posted this on saturday or whenever.

I actually already figured out this problem.  I specified the wrong value for the location in my FileItems in my custom FileBrowserContentProvider.  Here's a link to my blog article, RadFileExplorer First File Always Selected Bug Solved, with all the details.

Thanks for your help!
Tags
FileExplorer
Asked by
Ryan Fligg
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Ryan Fligg
Top achievements
Rank 1
Share this question
or