or
dataSource: {
transport: {
read: {
url: JsonPath,
dataType:
"json"
}
}
},
legend: {
position: LegendPosition,
visible: LegendVisible,
template:
"#= FormatLongText(value, 1) #"
,
font:
'8px Arial'
},
var
gridDataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"mysite"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
,
type:
"POST"
,
data:
function
() {
return
{
param: value
};
}
},
parameterMap:
function
(options) {
return
JSON.stringify(options);
}
},
schema: {
model: {
id:
"id"
,
fields: {
name: { type:
"string"
},
domain: { type:
"string"
},
lastSeen: { type:
"date"
},
os: { type:
"string"
}
}
// End of fields
},
// End of model
data:
"Entries"
,
total:
"TotalCount"
},
sort: {
field:
"name"
,
dir:
"asc"
},
pageSize: 14,
serverPaging:
true
,
serverSorting:
true
,
serverFiltering:
true
});
var
devicesDataGrid = $(
"#devicesGrid"
).kendoGrid({
selectable:
"row"
,
dataSource: gridDataSource,
autoBind:
false
,
columnMenu:
true
,
filterable:
true
,
scrollable:
false
,
sortable:
true
,
resizable:
true
,
height: 500,
columns: [ { title:
"Name"
, field:
"name"
, template:
"<a href='/GridVision/EditOrganizationDevice?organizationDeviceId=#= organizationDeviceId #'>#= name #</a>"
},
{ title:
"Domain"
, field:
"domain"
},
{ title:
"Operating System"
, field:
"os"
, template:
'<div class="ellipsisCell" title="#= os #">#= os #</div>'
},
{ title:
'Last Seen'
, field:
'lastSeen'
, template:
"#= kendo.toString(lastSeen, 'MMMM dd yyyy, h:mm tt') #"
}
],
pageable: { input:
true
, numeric:
false
, info:
true
},
}).data(
"kendoGrid"
);
gridDataSource.read();
jQuery.support.cors =
true
;
function
sendRequestKendo(url) {
ds =
new
kendo.data.DataSource({
transport: {
read: {
url: url,
type:
"GET"
}
},
change: onDataChanged,
error:
function
(response) {
alert(response.errorThrown);
$(
"#loginError"
).show();
}
});
ds.read();
}
function
onDataChanged() {
$(
"#results"
).html(kendo.stringify(ds.view()));
}
<
httpProtocol
>
<
customHeaders
>
<
add
name
=
"Access-Control-Allow-Origin"
value
=
"http://mydomain.com"
/>
<
add
name
=
"Access-Control-Allow-Headers"
value
=
"Content-Type"
/>
</
customHeaders
>
</
httpProtocol
>
$.ajaxSetup({
type:
"GET"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
});
$.ajax({
url: url,
success:
function
() {
},
error:
function
(response, status, err) {
$(
"#loginError"
).show();
$(
"#errorMessage"
).html(err);
}
});
Prepares the Grid for safe removal from DOM. Detaches all event handlers and removes jQuery.data attributes to avoid memory leaks. Calls destroy method of any child Kendo widgets.
var grid = $("#grid").data("kendoGrid");
// detach events
grid.destroy();
TypeError: rGrid.destroy is not a function
<
div
id
=
"example"
class
=
"k-content"
>
Select a title from Netflix:
<
input
id
=
"titles"
/>
<
button
id
=
"a"
/>
<
script
>
$(document).ready(function() {
var aa = $("#titles").kendoComboBox({
index: 0,
placeholder: "Select City",
dataTextField: "name",
dataValueField: "id_city",
filter: "contains",
dataSource: {
serverFiltering: true,
serverPaging: true,
pageSize: 20,
transport: {
}
}
});
$("#a").click(function (e) {
aa.refresh();
});
});
</
script
>
</
div
>