Hi Every one,
i am trying to load the CRM Entity list in Kendo List box. but with below code, i am not getting the list.
Can any one suggest how to load the CRM all Entity list kendo list box.
<!DOCTYPE html>
<html>
<head>
<base href="demos.telerik.com/.../index">
<style>
html {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<title></title>
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.common-material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.mobile.min.css" />
<script src="kendo.cdn.telerik.com/.../jquery.min.js"></script>
<script src="kendo.cdn.telerik.com/.../kendo.all.min.js"></script>
</head>
<body>
<div>
<table>
<tr>
<td class="auto-style1">Click to Load CRM Entities</td>
<td class="auto-style4">
<button type="button" ID="btnLoadInstance">Load Entities</button>
</td>
</tr>
</table>
</div>
<div id="example" role="application">
<div class="demo-section k-content">
<div>
<label for="optional" id="employees">Entities</label>
<label for="selected">Developers</label>
<br />
<select id="optional">
</select>
<select id="selected"></select>
</div>
</div>
<script>
$(document).ready(function () {
var Query = "EntityDefinitions?$select=DisplayName";
//var req = new XMLHttpRequest();
//req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);
var serverURL = "CRM URL"
var dataSource = new kendo.data.DataSource({
serverFiltering: true, // <-- Do filtering server-side
serverPaging: true,
type: "odata",
transport: {
read: {
url: serverURL + "/api/data/v8.2/" + Query,
dataType: "json"
},
parameterMap: function (options, type) {
var paramMap = kendo.data.transports.odata.parameterMap(options);
delete paramMap.$inlinecount; // <-- remove inlinecount parameter.
delete paramMap.$format; // <-- remove format parameter.
return paramMap;
}
},
schema: {
data: function (data) {
return data; // <-- The result is just the data, it doesn't need to be unpacked.
},
total: function (data) {
return data.length; // <-- The total items count is the data length, there is no .Count to unpack.
}
}
});
$("#optional").kendoListBox({
dataSource: dataSource,
dataTextField: "Label",
connectWith: "selected",
toolbar: {
tools: ["moveUp", "moveDown", "transferTo", "transferFrom", "transferAllTo", "transferAllFrom", "remove"]
}
});
$("#selected").kendoListBox();
});
</script>
</div>
<style>
.demo-section label {
margin-bottom: 5px;
font-weight: bold;
display: inline-block;
}
#employees {
width: 270px;
}
#example .demo-section {
max-width: none;
width: 515px;
}
#example .k-listbox {
width: 236px;
height: 310px;
}
#example .k-listbox:first-of-type {
width: 270px;
margin-right: 1px;
}
</style>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<base href="demos.telerik.com/.../index">
<style>
html {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<title></title>
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.common-material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.min.css" />
<link rel="stylesheet" href="kendo.cdn.telerik.com/.../kendo.material.mobile.min.css" />
<script src="kendo.cdn.telerik.com/.../jquery.min.js"></script>
<script src="kendo.cdn.telerik.com/.../kendo.all.min.js"></script>
</head>
<body>
<div style="align-items: center">
<h1 style="align-items: center">Portal for Data Obfuscation</h1>
</div>
<div>
<table>
<tr>
<td class="auto-style1">Click to Load CRM Entities</td>
<td class="auto-style4">
<button type="button" ID="btnLoadInstance">Load Entities</button>
</td>
</tr>
</table>
</div>
<div id="example" role="application">
<div class="demo-section k-content">
<div>
<label for="optional" id="employees">Entities</label>
<label for="selected">Developers</label>
<br />
<select id="optional">
</select>
<select id="selected"></select>
</div>
</div>
<script>
$(document).ready(function () {
var Query = "EntityDefinitions?$select=DisplayName";
//var req = new XMLHttpRequest();
//req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);
var serverURL = "CRM URL";
var dataSource = new kendo.data.DataSource({
serverFiltering: true,
serverPaging: true,
type: "odata",
transport: {
read: {
url: serverURL + "/api/data/v8.2/" + Query,
dataType: "json"
},
parameterMap: function (options, type) {
var paramMap = kendo.data.transports.odata.parameterMap(options);
delete paramMap.$inlinecount; // <-- remove inlinecount parameter.
delete paramMap.$format; // <-- remove format parameter.
return paramMap;
}
},
schema: {
data: function (data) {
return data; //
},
total: function (data) {
return data.length; //
}
}
});
$("#optional").kendoListBox({
dataSource: dataSource,
dataTextField: "Label",
connectWith: "selected",
toolbar: {
tools: ["moveUp", "moveDown", "transferTo", "transferFrom", "transferAllTo", "transferAllFrom", "remove"]
}
});
$("#selected").kendoListBox();
});
</script>
</div>
<style>
.demo-section label {
margin-bottom: 5px;
font-weight: bold;
display: inline-block;
}
#employees {
width: 270px;
}
#example .demo-section {
max-width: none;
width: 515px;
}
#example .k-listbox {
width: 236px;
height: 310px;
}
#example .k-listbox:first-of-type {
width: 270px;
margin-right: 1px;
}
</style>
</body>
</html>
*This post is locked for comments