prabhu p

prabhu p

  • 2k
  • 181
  • 98.1k

Uncaught TypeError: Cannot read property 'substr' of undefin

Nov 16 2016 11:26 PM
Iam getting this  jquery error
"Uncaught TypeError: Cannot read property 'substr' of undefind" 
 
 
---------------------------
<link href="Css/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" />
<link href="Css/ui.jqgrid.css" rel="stylesheet" type="text/css" />
<script src="Script/JqGrid/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="Script/JqGrid/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="Script/JqGrid/grid.locale-en.js" type="text/javascript"></script>
<script src="Script/JqGrid/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="Script/json2-min.js" type="text/javascript"></script>
<script src="Script/JqGrid/jquery.jqGrid.src.js" type="text/javascript"></script>
 
function FunctionRetunrSave(jsondata) {
debugger;
$('#<%= TrGrid.ClientID %>').show();
// $("#list1").jqGrid("clearGridData", true);
-------
$(document).ready(function() { -- iam getting that error on this line
------------------
var lastsel2;
jQuery("#list1").jqGrid({
datatype: "local",
colNames: ['StockistCode', 'StockistName', 'DIVISION_NAME'],
colModel: [
{ name: 'StockistCode', index: 'StockistCode', width: 500 },
{ name: 'StockistName', index: 'StockistName', width: 500 },
{ name: 'DIVISION_NAME', index: 'DIVISION_NAME', width: 500 },
],
pager: jQuery('#pager1'),
sortable: false,
viewrecords: true,
caption: "Query List",
width: 1100
}).navGrid(pager, { edit: false, add: true, del: false, refresh: true, search: false });
var mydata;
var thegrid = jQuery("#list1")[0];
if (jsondata != null) {
thegrid.addJSONData(JSON.parse(jsondata.responseText).d);
mydata = JSON.parse(jsondata.responseText).d;
}
var $grid = $("#list1");
for (var i = 0; i <= mydata.length; i++) {
jQuery("#list1").jqGrid('addRowData', i + 1, mydata[i]);
}
});
}
How to resolve this error ,Please do need full to me
 

Answers (2)