Hello
I have script manager in my page and am using kendoGrid. I am connecting the grid to the service. When this code runs I get the following error:
SCRIPT5007: Unable to get property 'length' of undefined or null reference
ScriptResource.axd, line 5 character 5907
I've checked the script manager code it is with the endWith, (String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a})
Thank you for your help
Below is the script used
I have script manager in my page and am using kendoGrid. I am connecting the grid to the service. When this code runs I get the following error:
SCRIPT5007: Unable to get property 'length' of undefined or null reference
ScriptResource.axd, line 5 character 5907
I've checked the script manager code it is with the endWith, (String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a})
Thank you for your help
Below is the script used
$(document).ready(
function
() { Sys.Application.add_load(initContactsPage); });
var
contactsGrid =
null
;
function
initContactsPage()
{
var
contactsColumns = [{
field:
"CustomerName"
,
title:
"Name"
,
template:
'<a class="name" href="ContactDetails.aspx?Id=#=CustomerID#">#=CustomerName#</a>'
},
{
field:
"strCustomerNumber"
,
title:
"Number"
},
{
field:
"strMainPhone"
,
title:
"Phone"
},
{
field:
"strCity"
,
title:
"City"
},
{
field:
"strWebsite"
,
title:
"Web Site"
}
];
contactsGrid = $(
"#gvContacts"
).kendoGrid({
columns: contactsColumns,
dataSource:
new
kendo.data.DataSource({
pageSize: 10, serverPaging:
true
, page: 1,
schema:
{
total:
"VirtualTotal"
,
data:
"Records"
},
transport:
{
read:
{
url:
"/Services/APIService.asmx/ListObjectRecords"
,
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
data: getData()
}
},
error:
function
(e)
{
}
}),
groupable:
false
,
scrollable:
false
,
pageable:
true
}).data(
"kendoGrid"
);
}
function
searchContacts(page)
{
contactsGrid.dataSource.page(1);
}
function
getData()
{
var
contactsParams = {};
contactsParams[
"objectId"
] =
"C9D9AEC9-F6C2-4EB3-8F00-D32A45A7C4C7"
;
contactsParams[
"textFilter"
] =
null
;
contactsParams[
"sortColumn"
] =
null
;
contactsParams[
"startIndex"
] = 1;
contactsParams[
"pageSize"
] = 10;
return
JSON.stringify(contactsParams);
}