or
$(
"#articleList"
).kendoGrid({
columns: [
{
field:
"ArticleId"
,
title:
"ID"
,
template:
"<a href='"
+appRoot+
"/Home/Detail/${ArticleId}/${ArticleVersion}/${gridPageNumber}'>${ArticleId}</a>"
,
width: 75
},
....
SCRIPT5007: Unable to get value of the property 'toString': object is null or undefined
public
JsonResult Index()
{
StreamReader sr =
null
;
string
json =
string
.Empty;
WebRequest request = WebRequest.Create(
"http://192.168.1.8:99/GetClienti?format=json"
);
using
(WebResponse response = request.GetResponse())
{
sr =
new
StreamReader(response.GetResponseStream(),
true
);
json = sr.ReadToEnd();
}
int
index = json.IndexOf(
'['
);
json = json.Substring(index);
index = json.LastIndexOf(
']'
);
json = json.Substring(0, json.Length + 1 - Math.Abs(index - json.Length));
return
Json(json, JsonRequestBehavior.AllowGet);
}
...
<input id=
"kendoCboClienti"
/>
...
<script type=
"text/javascript"
>
$(document).ready(function () {
$(
"#kendoCboClienti"
).kendoComboBox({
placeholder:
"Sceglie il cliente"
,
dataTextField:
"RAGIONE_SOCIALE"
,
dataValueField:
"ID"
,
dataSource: {
transport: {
read: {
url:
"/Clienti/"
,
dataType:
"json"
}
},
schema: {
model: {
fields: {
id: { type:
"number"
},
ragioneSociale: { type:
"string"
}
}
}
}
}
});
});
</script>
<
form
id
=
"frmPedido"
method
=
"post"
action
=
""
data-bind
=
"source: pedidos"
>
<
ul
>
<
li
><
label
for
=
"pedido"
>Pedido:</
label
><
input
type
=
"text"
id
=
"pedido"
data-bind
=
"value: pedido"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"nomecontato"
>Seu Nome:</
label
><
input
type
=
"text"
id
=
"nomecontato"
data-bind
=
"value: nomecontato"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"telcontato"
>Seu Telefone:</
label
><
input
type
=
"text"
id
=
"telcontato"
data-bind
=
"value: telcontato"
class
=
"k-input"
/><
label
for
=
"celcontato"
>Seu Celular:</
label
><
input
type
=
"text"
id
=
"celcontato"
data-bind
=
"value: celcontato"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"nomedaigreja"
>Nome da Igreja:</
label
><
input
type
=
"text"
id
=
"nomedaigreja"
data-bind
=
"value: nomedaigreja"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"qtdmembros"
>Qtd. Membros:</
label
><
input
type
=
"text"
id
=
"qtdmembros"
data-bind
=
"value: qtdmembros"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"email"
>Seu Email:</
label
><
input
type
=
"text"
id
=
"email"
data-bind
=
"value: email"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"cnpj"
>CNPJ da Igreja:</
label
><
input
type
=
"text"
id
=
"cnpj"
data-bind
=
"value: cnpj"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"nomepastor"
>Nome do Pastor:</
label
><
input
type
=
"text"
id
=
"nomepastor"
data-bind
=
"value: nomepastor"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"rgpastor"
>RG do Pastor:</
label
><
input
type
=
"text"
id
=
"rgpastor"
data-bind
=
"value: rgpastor"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"cpfpastor"
>CPF do Pastor:</
label
><
input
type
=
"text"
id
=
"cpfpastor"
data-bind
=
"value: cpfpastor"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"icep"
>CEP:</
label
><
input
type
=
"text"
id
=
"icep"
data-bind
=
"value: icep"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"iendereco"
>Endereço:</
label
><
input
type
=
"text"
id
=
"iendereco"
data-bind
=
"value: iendereco"
class
=
"k-input"
/><
label
for
=
"inumero"
>Número:</
label
><
input
type
=
"text"
id
=
"inumero"
data-bind
=
"value: inumero"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"icomplemento"
>Complemento:</
label
><
input
type
=
"text"
id
=
"icomplemento"
data-bind
=
"value: icomplemento"
class
=
"k-input"
/><
label
for
=
"ibairro"
>Bairro:</
label
><
input
type
=
"text"
id
=
"ibairro"
data-bind
=
"value: ibairro"
class
=
"k-input"
/></
li
>
<
li
><
label
for
=
"icidade"
>Cidade:</
label
><
input
type
=
"text"
id
=
"icidade"
data-bind
=
"value: icidade"
class
=
"k-input"
/><
label
for
=
"iestado"
>Estado:</
label
><
input
type
=
"text"
id
=
"iestado"
data-bind
=
"value: iestado"
class
=
"k-input"
/></
li
>
<
li
><
input
type
=
"button"
id
=
"btnEnviar"
value
=
"Enviar"
class
=
"k-button"
></
li
>
</
ul
>
</
form
>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
compra
>
<
info
>
<
pedido
>100001323</
pedido
>
<
valorpedido
>353.99</
valorpedido
>
<
valorboleto
>140</
valorboleto
>
<
nomedaigreja
>PRIMEIRA IGREJA DO BRASIL</
nomedaigreja
>
<
cnpj
>00.000.000/0000-00</
cnpj
>
<
icep
>13800-000</
icep
>
<
iendereco
>AVENIDA DOS CASTELOS NEGROS</
iendereco
>
<
inumero
>981</
inumero
>
<
icomplemento
>CASA</
icomplemento
>
<
ibairro
>CENTRO</
ibairro
>
<
icidade
>MOJI MIRIM</
icidade
>
<
iestado
>SP</
iestado
>
<
email
>diego.srs@gmail.com</
email
>
<
emailigreja
>contato@soareseneves.com.br</
emailigreja
>
<
nomecontato
>DOUGLAS SOARES</
nomecontato
>
<
telcontato
>1938628680</
telcontato
>
<
celcontato
>1899633617</
celcontato
>
<
teligreja
>1899859794</
teligreja
>
<
software
>6</
software
>
<
qtla
>1</
qtla
>
<
banco
>0</
banco
>
<
datadeposito
>14-06-2012</
datadeposito
>
<
suporte
>4</
suporte
>
<
nomepastor
>DIEGO SOARES</
nomepastor
>
<
rgpastor
>453010507</
rgpastor
>
<
cpfpastor
>34852052816</
cpfpastor
>
<
boleto
>100001323</
boleto
>
<
sedex
>22</
sedex
>
<
formapagto
>2</
formapagto
>
<
tipopagto
>1</
tipopagto
>
<
cep
>69970-000</
cep
>
<
aoscuidados
>FRANCISCO SOARES</
aoscuidados
>
<
endereco
>RUA DAS OSTRAS</
endereco
>
<
numero
>172</
numero
>
<
complemento
>APTO 130</
complemento
>
<
bairro
>CENTRO</
bairro
>
<
cidade
>MOJI MIRIM</
cidade
>
<
estado
>SP</
estado
>
<
qtdmembros
>500</
qtdmembros
>
<
obs
>BOM PROGRAMA</
obs
>
<
parcelas
>3</
parcelas
>
<
valorparcelas
>116.70</
valorparcelas
>
<
afiliado
>0</
afiliado
>
</
info
>
</
compra
>
<script type=
"text/javascript"
>
$(
function
() {
var
pedidoSource =
new
kendo.data.DataSource({
transport: {
read:
"xml/100001323.xml"
},
schema: {
type:
"xml"
,
data:
"/compra/info"
,
model: {
id:
"pedido/text()"
,
fields: {
pedido:
"pedido/text()"
,
nomedaigreja:
"nomedaigreja/text()"
,
cnpj:
"cnpj/text()"
,
icep:
"icep/text()"
,
iendereco:
"iendereco/text()"
,
inumero:
"inumero/text()"
,
icomplemento:
"icomplemento/text()"
,
ibairro:
"ibairro/text()"
,
icidade:
"icidade/text()"
,
iestado:
"iestado/text()"
,
email:
"email/text()"
,
nomecontado:
"nomecontato/text()"
,
telcontato:
"telcontato/text()"
,
celcontato:
"celcontato/text()"
,
datadeposito:
"datadeposito/text()"
,
nomepastor:
"nomepastor/text()"
,
rgpastor:
"rgpastor/text()"
,
cpfpastor:
"cpfpastor/text()"
,
qtdmembros:
"qtdmembros/text()"
}
}
}
});
pedidoSource.read();
var
viewModel = kendo.observable({
pedidos: pedidoSource
});
kendo.bind($(
"form"
), viewModel);
});
</script>
data-columns='[{
"field"
:
"pdrID"
,
"title"
:
"PdrID"
},
{
"field"
:
"rotationName"
,
"title"
:
"Rotation"
},
{
"field"
:
"siteCapacityID"
,
"title"
:
"CapacityID"
},
{
"field"
:
"ruleID"
,
"title"
:
"RuleID"
},
{
"field"
:
"userID"
,
"title"
:
"UserID"
},
{
"field"
:
"name"
,
"title"
:
"Student"
},
{
"field"
:
"location"
,
"title"
:
"Site"
},
{
"field"
:
"statusDesc"
,
"title"
:
"Status"
},
{
"field"
:
"pref"
,
"title"
:
"Pref"
},
{
"field"
:
"campusName"
,
"title"
:
"Campus"
},
{
"field"
:
"startDate"
,
"title"
:
"Start"
},
{
"field"
:
"endDate"
,
"title"
:
"End"
}
]'