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

RadGrid Self referencing Hierarchy get_parentRow() in Fire Fox

3 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 14 Oct 2009, 01:32 PM
Hi,

I have a RadGrid with self-referencing hierarchy and on 'RowSelected' client event I am trying to get the text of the parent row.
I am using code below which works well in IE and Chrome, but returns nothing in Fire Fox. Is there any work around for this?

eventArgs.get_tableView().get_parentRow().cells[0].innerText

Thanks

3 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 19 Oct 2009, 10:19 AM
Hi TelNew,

For Firefox, the property you need is innerHTML :

eventArgs.get_tableView().get_parentRow().cells[0].innerHTML


Best wishes,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sunny
Top achievements
Rank 1
answered on 20 Oct 2009, 05:20 PM
I just need the Text (for example from code below, Employee). If I use innerHTML its giving me

<td name="ctl00$ContentPlaceHolder1$radGrdid...>&nbsp;Employee<..

Any other solution?

I even tried to use the code below, but I have problem with this. For example my grid is like below
Parent1
 -Child1
 -Child2
Parent2
 -ChildA
 -ChildB
Parent3

If I select ChildA or ChildB under Parent2, This code is returning "Parent3" i.e sectionRowIndex is returning "2".

        var selectedindex = eventArgs.get_itemIndexHierarchical(); 
        var table = eventArgs.get_tableView(); 
        var ParentRow = table.get_parentRow(); 
        if (ParentRow != null) { 
            var masterTable = sender.get_masterTableView(); 
            var currentrow = masterTable.get_dataItems()[ParentRow.sectionRowIndex]; 
            alert(currentrow.getDataKeyValue("Name")) 
        }  



0
Veli
Telerik team
answered on 22 Oct 2009, 11:56 AM
Hello TelNew,

What you are gettings seems like outerHTML(). When you call innerHTML() on a DOM <td> element, the returned result should be anything that is inside the opening and closing tag, but without the <td> tags.

Additionally, try the textContent property in Firefox.

Best wishes,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Sunny
Top achievements
Rank 1
Answers by
Veli
Telerik team
Sunny
Top achievements
Rank 1
Share this question
or