This is a migrated thread and some comments may be shown as answers.
Cellindex of Radnumerictextbox in a radgrid
3 Answers 32 Views
This is a migrated thread and some comments may be shown as answers.
Neha
Top achievements
Rank 1
Neha asked on 18 Mar 2011, 06:54 AM
There is a context menu for the controls in a radgrid. Following is a part of client-side script for displaying the menu:
function contextMenu(sender, args)
{
        var evt = args.get_domEvent();
        var td = (evt.srcElement) ? args.srcElement : evt.target;
        var cols = args.get_tableView().get_columns();
        var col = cols[td.parentElement.cellIndex]; //-----> this is undefined
        var index = args.get_itemIndexHierarchical();
        document.getElementById("radGridClickedRowIndex").value = index;
        document.getElementById("radGridClickedColName").value = col.get_uniqueName();
        document.getElementById("radGridModifiedValue").value = td.value;
        //................
}

It is working fine for asp:textbox but not able to get 'CellIndex' for the Radnumerictextbox.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Mar 2011, 05:44 PM
Hello Neha,

I recommend that you use parentNode instead of parentElement otherwise you may have problems in non-IE browsers.

I would also suggest that you examine the way we have implemented the context menu in our online demo:
AJAX-enabled Context Menu

Best regards,
Daniel
the Telerik team
0
Neha
Top achievements
Rank 1
answered on 24 Mar 2011, 11:08 AM
Hi,
Thanks for the suggestion :) we will surely look into that. Anyways.. we got the above issue solved by using: "td.parentElement.parentElement.cellIndex"
0
Daniel
Telerik team
answered on 24 Mar 2011, 02:10 PM
Hello Neha,

I'm glad that you have found a solution to this problem. Let me reiterate that parentElement does not work in all cases - in Mozilla Firefox for example.

Best regards,
Daniel
the Telerik team
Tags
Input
Asked by
Neha
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Neha
Top achievements
Rank 1
Share this question
or