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

window.open problem in safari

1 Answer 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Md.Abdullah
Top achievements
Rank 1
Md.Abdullah asked on 06 Feb 2012, 12:19 PM
Hello,
I have a gridview like,
<telerik:RadGrid ID="RadGrid1" GridLines="None" Width="485" ShowGroupPanel="false"
                AllowFilteringByColumn="true" runat="server" CellSpacing="0" AutoGenerateColumns="false"
                OnItemDataBound="RadGrid1_ItemDataBound" AllowSorting="true">
                <ClientSettings AllowDragToGroup="true" AllowRowsDragDrop="true" AllowAutoScrollOnDragDrop="true"
                    AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowColumnsReorder="True"
                    Animation-AllowColumnRevertAnimation="true" ColumnsReorderMethod="Reorder" Animation-AllowColumnReorderAnimation="true">
                    <ClientEvents OnRowDblClick="RowDblClick" />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
                <MasterTableView ShowGroupFooter="false" AllowMultiColumnSorting="true" EnableHeaderContextMenu="true"
                    GroupsDefaultExpanded="false">
                    <Columns>                      
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                            Visible="true" UniqueName="Name">
<telerik:GridBoundColumn DataField="userType" HeaderText="Type" SortExpression="userType"
                            Visible="true" UniqueName="userType">
                        </telerik:GridBoundColumn>                       
                        <telerik:GridTemplateColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                            UniqueName="Address">
                            <ItemTemplate>
                                <asp:Label ID="lblVersion" runat="server" Text='<%#Eval("Address") %>'>
                                </asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>                      
                        <telerik:GridTemplateColumn DataField="attachment" AllowFiltering="false" Display="false"
                            UniqueName="attachment">
                            <ItemTemplate>
                                <asp:Label ID="hfattachment" runat="server" Text='<%#Eval("attachment") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="Name" />
                                <telerik:GridGroupByField FieldName="Type" />                            
                            </GroupByFields>
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="File_Name" HeaderText="Name   " />                               
                            </SelectFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                </MasterTableView>
                <GroupingSettings ShowUnGroupButton="false" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
----------------------

I have dabble click option here, when I dabble click a row it show it's attachment....
dabble click function is...

<script type="text/javascript">


            function DownloadFile(filepath) {
                alert(filepath);
                window.open(filepath, '_blank', 'top=200, left=250,height=400,width=700,status=yes,toolbar=no,menubar=no,location=yes,resizable=yes');
            }    

            function RowDblClick(sender, eventArgs) {
                var rowIndex = eventArgs.get_itemIndexHierarchical();
                var grid = $find("<%=RadGrid1.ClientID %>");

                var masterTableView = grid.get_masterTableView();
                var item = masterTableView._dataItems[rowIndex];
                var items = eventArgs.get_gridDataItem();
                var Element = items._element;
                if (Element) {
                    var keyValues = Element.cells[3].innerText;
                    alert(keyValues);
                    DownloadFile(keyValues);                           
                }
            }
    
        </script>

------------------------
Everything is good here for other browser but, when I run the application with safari (i am using 5.0.1) then it take also my localhost address ( like- http://localhost:53809/myapp/%20%20%20http://www.mydomain.com/myfile.doc)
any one please tell me why this is happening ?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 08 Feb 2012, 05:41 PM
Hello Abdullah,

 This is some strange behavior. What I can advise is that you debug your code and see what is the exact URL you pass to the function, i.e. is the alert displaying the correct path? If so then I believe there is very little you can do, as this is out of our control. Once you call window.open it is entirely up to the browser to manage things from there. What you can try is to start removing some of the arguments you pass and see if this can fix it. You can also try adding a RadWindowManager to the page and use radopen() to open your URL in a RadWindow. You can see the approach in this demo.

Greetings,
Marin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Md.Abdullah
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or