Ошибка выполнения Javascript: не удалось установить свойство 'classname' неопределенной или нулевой ссылки
Unable to set property 'className' of undefined or null reference. When i click the selected row in a grid i am getting the following error. It should fire gridview_selectedIndexChanged() event. but it will not fire anything. rather than it will shoe the below error. Error : JavaScript runtime error: Unable to set property 'className' of undefined or null reference. Error code : ASPX Page var gridviewID = "<%=grdSearch.ClientID%>"; var gridview = null; var selectedRowIndex = -1; $(document).ready(function () { gridview = $('#' + gridviewID); }); function RowMouseOver(rowIndex) { if (selectedRowIndex == rowIndex) return; var gridviewID = "<%=grdSearch.ClientID%>"; $('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItemHover'; } function RowMouseOut(rowIndex) { if (selectedRowIndex == rowIndex) return; var gridviewID = "<%=grdSearch.ClientID%>"; $('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItem'; } function RowSelect(rowIndex) { if (selectedRowIndex == rowIndex) return; RowReset(selectedRowIndex); selectedRowIndex = rowIndex; var gridviewID = "<%=grdSearch.ClientID%>"; $('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItemSelected'; } function RowReset(rowIndex) { var gridviewID = "<%=grdSearch.ClientID%>"; $('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItem'; } ASPX.Vb If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType <> DataControlRowType.DataRow Then Return End If e.Row.Attributes( "onmouseover") = String.Format("RowMouseOver({0});", e.Row.RowIndex) e.Row.Attributes.Add( "style", "cursor:pointer;") e.Row.Attributes( "onmouseout") = String.Format("RowMouseOut({0});", e.Row.RowIndex) e.Row.ToolTip = "Click to select row" e.Row.Attributes( "onclick") = String.Format("RowSelect({0});", e.Row.RowIndex) End If my Requirment is : When i selecte the particular row, it should highlight the row in diff color at the same time the index value should get display in another gridview pls. help me to solve this problem. i am unable to find out exact solution for this.
Что я уже пробовал:
функция RowReset(rowIndex) {
$('#' + gridviewID +'элемента tbody &ГТ; тр').эквалайзер(параметр rowindex+1).добавление('GridviewScrollItem');
}
Но, не работает...