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

Get FileExpolorer pagerindex

5 Answers 28 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Fit2Page asked on 30 Oct 2013, 09:07 AM
Hi,

Any idea why the following clientscript always returns 0?
var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
    alert(oExplorer.get_listView().get_currentPageIndex());

Thanks,

Marc

5 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 31 Oct 2013, 03:22 PM
Hello Marc,

The ListView is the control, which is listing the files when FileExplorer's ExplorerMode is set to Thumbnais. I assume that you are using FileExplorer in the default grid mode, which means that you can access the current page index in a similar way:
<telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" AllowPaging="true" PageSize="5" ExplorerMode="Default">
    <Configuration ViewPaths="~/" />
</telerik:RadFileExplorer>
<asp:Button ID="Button1" runat="server" Text="Current page" OnClientClick="ShowPage(); return false;" />
<script type="text/javascript">
    function ShowPage() {
        var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
        alert(oExplorer.get_grid().get_masterTableView().get_currentPageIndex());
    }
</script>

I hope this helps.

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.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 04 Nov 2013, 09:24 AM
Hi Veselina,

That is just the point. I use ListView mode but I cannot read the PagerSetting.
Can you reproduce this?

Marc
0
Vessy
Telerik team
answered on 04 Nov 2013, 03:36 PM
Hi Marc,

Thank you for the clarification - indeed I was able to reproduce the described issue in Thumbnails mode of FileExplorer and I have logged it int our bug tracking system. You can see the progress of the bug here: feedback. I have also updated your Telerik Points accordingly.

For he time being, you can use the following workaround in order to access the current page index:
function ShowPage() {
    var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
    var slider = $find(oExplorer.get_id() + "_FileListPageControlSlider");
    var pageIndex = slider.get_value();
    alert(pageIndex);
}

I hope this helps.

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.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 05 Nov 2013, 03:13 PM
Hi Veselina,

I try to explain what my exact problem is. I discovered that the pager in the RadFileExplorer remembers it's own setting when I have the FileExplorer set on GridView. When I switch to Listview the Pager setting is not kept. I use a FileExplorer in which I added an ImageEditor to the Context menu. So let's say when I open the imageEditor for a file on page 2 and I cancel it the pager always returns to page1. In GridView it neatly stays on page 2.

I can send code if that would you help to reproduce the problem.

Marc
0
Vessy
Telerik team
answered on 07 Nov 2013, 02:41 PM
Hello Marc,

The pager in the GridView mode of FileExplorer is built-in the Grid control, while the one in the ListView is additionally added Slider control, so it does not provide all the functionality which come with the Grid.

What I could suggest you is to save the current page in a hidden field (you can do it on your custom context menu item's Client-Click handler) and to set it as a value to the Slider when the ImageEditor is closed. In order to access the current value of the Slider, you can use the method provided in my previous reply:
var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
var slider = $find(oExplorer.get_id() + "_FileListPageControlSlider");
var pageIndex = slider.get_value();

and respectively to set the desired value in a similar manner:
slider.set_value(2); //sets the page index

I hope this approach will be suitable for your scenario.

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
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Vessy
Telerik team
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or