Hi,
I'm using radgrid with a context menu. Upon clicking the id column of the row is saved in a hidden textbox. The context menu uses the textbox value to open a radwindow. Following is the related code.
When a context menu item is clicked:
The issue occurs on grouping the grid with 2 or more columns. It works fine with first few rows(5-7) but as we go down to lower rows, I get
Microsoft JScript runtime error: 'undefined' is null or not an object
It breaks on following code:
Please look into this issue. Going by the function name it looks like its a grid related issue.
Edit: System Info
Web.UI Version - 2008.1.515.35
.NET Framework - 3.5
Visual Studio 2008
Browser - IE 7
Regards
Mridul
I'm using radgrid with a context menu. Upon clicking the id column of the row is saved in a hidden textbox. The context menu uses the textbox value to open a radwindow. Following is the related code.
function RowContextMenu(sender, eventArgs) |
{ |
var menu = $find("<%=RadMenu1.ClientID %>"); |
var evt = eventArgs.get_domEvent(); |
if(evt.target.tagName == "INPUT" || evt.target.tagName == "A") |
{ |
return; |
} |
var dataItem = $get(eventArgs.get_id()); |
var grid = sender; |
var MasterTable = grid.get_masterTableView(); |
var row = MasterTable.get_dataItems()[dataItem.rowIndex-1]; |
var cell = MasterTable.getCellByColumnUniqueName(row, "TicketNo"); |
//here cell.innerHTML holds the value of the cell |
var TicketNo = cell.innerText; |
var index = eventArgs.get_itemIndexHierarchical(); |
document.getElementById("radGridClickedRowIndex").value = TicketNo; |
sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true); |
menu.show(evt); |
evt.cancelBubble = true; |
evt.returnValue = false; |
if (evt.stopPropagation) |
{ |
evt.stopPropagation(); |
evt.preventDefault(); |
} |
} |
When a context menu item is clicked:
function onClicking(sender, eventArgs) |
{ |
var item = eventArgs.get_item(); |
var navigateUrl = item.get_text(); |
var ticketNo = document.getElementById("radGridClickedRowIndex").value; |
if (navigateUrl == "Reassign") |
{ |
var oWindow = window.radopen ("Reassign.aspx?INC=" + ticketNo, null); |
oWindow.setSize(300,200); |
oWindow.moveTo(400, 300); |
oWindow.add_close(OnClientClose); |
} |
} |
The issue occurs on grouping the grid with 2 or more columns. It works fine with first few rows(5-7) but as we go down to lower rows, I get
Microsoft JScript runtime error: 'undefined' is null or not an object
It breaks on following code:
getCellByColumnUniqueName:function(_1de,_1df){ |
for(var i=0;i<this.get_columns().length;i++){ |
if(this.get_columns()[i].get_element().UniqueName.toUpperCase()==_1df.toUpperCase()){ |
return _1de.get_element().cells[i]; <-- This is where the error points --> |
} |
Please look into this issue. Going by the function name it looks like its a grid related issue.
Edit: System Info
Web.UI Version - 2008.1.515.35
.NET Framework - 3.5
Visual Studio 2008
Browser - IE 7
Regards
Mridul