Build, protect and deploy apps across any platform and mobile device
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Build rich, smart HTML5 and JavaScript apps for any platform, browser or device
Automate UI, load and performance testing for web, desktop and mobile
Use Angular, TypeScript or JavaScript to build truly native mobile apps
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
Automate decision processes with a no-code business rules engine
Build mobile apps for iOS, Android and Windows Phone
A complete cloud platform for an app or your entire digital business
Deploy automated machine learning to accurately predict machine failures with technology optimized for Industrial IoT.
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Adding a Kendo UI Grid as a widget to any Rollbase page is easy. In this blog, we'll show you how to generate a responsive grid that fits any screen size. Rollbase provides out-of-the-box, no-code rendering for lists of objects using Kendo UI Grids. That is, as soon as you declare an object using point-and-click, drag-and-drop methodology, you get an auto-generated UI with very powerful grid control. But how would you go about showing a Kendo UI Grid containing, for example, data from multiple objects or a grid that you would like to tailor to your custom needs?
In this post, we'll show you how to easily add a Kendo UI Grid as a widget in any Rollbase page. You will also see the additional benefits you get out of the box when the custom grid is part of the page cells.
Here is how we need to proceed, we will do the work from the page designer:
That's all there is to it. Here is the JavaScript code to achieve this:
01.
<div id=
"grid"
style=
"width:100%;"
></div>
02.
<script>
03.
rb.newui.util.addEventListener(
"rbs_pageRender"
,
function
() {
04.
buildData(values) {
05.
var
gridData = [];
06.
if
(values) {
07.
for
(
i = 0; i < values.length; i++) {
08.
data = {
09.
name: values[i][0],
10.
class: values[i][1],
11.
age: values[i][2]
12.
}
13.
gridData.push(data);
14.
15.
generateKendoGrid(gridData);
16.
17.
18.
19.
generateKendoGrid(gridData) {
20.
dataSource =
new
kendo.data.DataSource({data: gridData});
21.
kendoGrid = $(
'#grid'
).kendoGrid({
22.
columns: [{
23.
field:
'name'
24.
title:
'Name'
25.
groupable:
false
//Let's make this field not groupable
26.
}, {
27.
'age'
28.
'Age'
29.
30.
'class'
31.
'Class'
32.
}],
33.
34.
groupable: { messages:
35.
{empty:
"Drag and Drop Age or Class Columns here for grouping"
}},
36.
dataSource: dataSource
37.
});
38.
39.
40.
// Access the data -> on callback, we will build data source
41.
rbf_selectQuery(
"SELECT name,Class,Age FROM Students"
, 200, buildData);
42.
43.
</script>
Now here is how it renders (with Material Black theme): Even on a smartphone, the grid rendering looks good:
It is worth noting that since the Kendo UI Grid belongs to a section cell, we get a lot of benefits out of the box:
Here is an example where we have a responsive section with two columns. The left column has the student grid and the second column features a chart showing the number of students per class. On desktop:
On tablet: In summary, we saw how easy it is to render a Kendo UI Grid and add it to the no-code responsive system. We can apply the same technique to any widget and construct very creative and innovative pages, thanks to the rich set of Kendo UI widgets available. Stay tuned, we will write more blogs showing how to use other widgets like pivot grids and Gantt charts. Check this blog for more details on how to create custom dashboards using Kendo UI Charts.
Thierry Ciot is a Software Architect and Product Owner on Progress Rollbase. Ciot has gained a broad experience in the development of products ranging from development tools to production monitoring systems. He is using his expertise to create a low code/rapid application development platform that provides a “Yes!” user experience. He is now focusing on responsive and adaptive modern web applications for public and private clouds. He holds two patents in the memory management space.
Copyright © 2017 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.