or
custom1DataSource =
new
kendo.data.DataSource({
serverFiltering:
true
,
transport: {
read: {
url:
"wsRest.svc/custom1/"
,
data: {
user:
function
() {
return
userField.value;
},
client:
function
() {
return
$(
"#clientCombo"
).val();
},
matter:
function
() {
return
$(
"#matterCombo"
).val();
}
}
}
},
change:
function
() {
//when data is updated, if there is more than 1 item we need to enable the menu
var
custom1 = $(
"#custom1Combo"
).data(
"kendoDropDownList"
);
custom1.enable(
false
);
if
(custom1DataSource.data().length > 1) {
custom1.enable(
true
);
$(
"#custom1Combo"
).focus();
}
else
{
$(
"#portraitNotes"
).focus();
}
}
});
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"http://dsdmservices.azurewebsites.net/dsdmRest.svc/GetContent?BookMenuID=4"
, // the remove service url
dataType:
"jsonp"
// JSONP (JSON with padding) is required for cross-domain AJAX
}
}
});
dataSource.read();
alert(dataSource.length);
var
dataItem = dataSource[0];
$(
'#divContent'
).html(dataItem.Content);
var
testDataSource =
new
kendo.data.DataSource(
{
transport: {
read: {
url:
"/api/Grids/Events"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
,
type:
"POST"
,
data:
function
() {
return
{
filterId: filterId
};
}
},
parameterMap:
function
(options) {
return
JSON.stringify(options);
}
},
schema: {
model: {
id:
"organizationDeviceId"
,
fields: {
organizationDeviceName: { type:
"string"
},
EventName: { type:
"string"
},
EventDetails: { type:
"string"
},
EventSeverity: { type:
"string"
},
EventDate: { type:
"date"
}
}
// End of fields
},
// End of model
data:
"Entries"
,
total:
"TotalCount"
},
sort: {
field:
"EventDate"
,
dir:
"desc"
},
pageSize: 14,
serverPaging:
true
,
serverSorting:
true
,
serverFiltering:
true
}
);
var
EventsDataGrid = $(
"#eventsGrid"
).kendoGridWithTitles({
selectable:
"row"
,
dataSource: testDataSource,
columnMenu:
true
,
filterable:
true
,
scrollable:
true
,
sortable:
true
,
resizable:
true
,
height: 500,
toolbar: kendo.template($(
"#filterToolbarTemplate"
).html()),
columns: [ { title: Globalize.localize(
"Dashboards_Events_DeviceName"
), field:
"organizationDeviceName"
, template:
"<a href='//OrganizationDevice?organizationDeviceId=#= organizationDeviceId #'>#= organizationDeviceName #</a>"
},
{ title: Globalize.localize(
"Dashboards_Events_EventName"
), field:
"EventName"
},
{ title: Globalize.localize(
"Dashboards_Events_EventDetails"
), field:
"EventDetails"
},
{ title: Globalize.localize(
"Dashboards_Events_EventSeverity"
), field:
"EventSeverity"
},
{ title: Globalize.localize(
"Dashboards_Events_Date"
), field:
'EventDate'
, template:
"<div>#= kendo.toString(EventDate, CloudSAAS.GeneralDateTimeFormat) #</div>"
}
],
pageable: { input:
true
, numeric:
false
},
}).data(
"kendoGrid"
);
var
EventsDataGrid = $(
"#eventsGrid"
).kendoGridWithTitles({
selectable:
"row"
,
dataSource: {
transport: {
read: {
url:
"/api/Grids/Events"
,
dataType:
"json"
,
contentType:
"application/json; charset=utf-8"
,
type:
"POST"
,
data:
function
() {
return
{
filterId: filterId
};
}
},
parameterMap:
function
(options) {
return
JSON.stringify(options);
}
},
schema: {
model: {
id:
"organizationDeviceId"
,
fields: {
organizationDeviceName: { type:
"string"
},
EventName: { type:
"string"
},
EventDetails: { type:
"string"
},
EventSeverity: { type:
"string"
},
EventDate: { type:
"date"
}
}
// End of fields
},
// End of model
data:
"Entries"
,
total:
"TotalCount"
},
sort: {
field:
"EventDate"
,
dir:
"desc"
},
pageSize: 14,
serverPaging:
true
,
serverSorting:
true
,
serverFiltering:
true
},
columnMenu:
true
,
filterable:
true
,
scrollable:
true
,
sortable:
true
,
resizable:
true
,
height: 500,
toolbar: kendo.template($(
"#filterToolbarTemplate"
).html()),
columns: [ { title: Globalize.localize(
"Dashboards_Events_DeviceName"
), field:
"organizationDeviceName"
, template:
"<a href='//OrganizationDevice?organizationDeviceId=#= organizationDeviceId #'>#= organizationDeviceName #</a>"
},
{ title: Globalize.localize(
"Dashboards_Events_EventName"
), field:
"EventName"
},
{ title: Globalize.localize(
"Dashboards_Events_EventDetails"
), field:
"EventDetails"
},
{ title: Globalize.localize(
"Dashboards_Events_EventSeverity"
), field:
"EventSeverity"
},
{ title: Globalize.localize(
"Dashboards_Events_Date"
), field:
'EventDate'
, template:
"<div>#= kendo.toString(EventDate, CloudSAAS.GeneralDateTimeFormat) #</div>"
}
],
pageable: { input:
true
, numeric:
false
},
}).data(
"kendoGrid"
);
$(
"#txtActions"
).kendoEditor({
tools: [
"bold"
,
"italic"
,
"underline"
,
"insertUnorderedList"
,
"insertOrderedList"
,
],
paste:
function
(e) {
var
editor = $(
"#txtActions"
).data(
"kendoEditor"
);
editor.value(CleanWordHTML(e.html));
//console.log(editor);
}
});