introduction to kendo mobile applications

12
Introduction to Kendo Mobile Applications. LUNCH AND LEARN.

Upload: george-orhewere

Post on 27-Jan-2017

195 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Introduction to Kendo Mobile Applications

Introduction to Kendo Mobile Applications.LUNCH AND LEARN.

Page 2: Introduction to Kendo Mobile Applications

Scope.

Kendo UI Framework.

First Kendo Mobile Application

Kendo Mobile Widgets

DataSource.

Templates

MVVM

Page 3: Introduction to Kendo Mobile Applications

Kendo UI Framework.

The Kendo UI Framework can be grouped into 2 broad areas: Kendo UI Widgets

It includes all UI elements that we "see" once the application is developed such as the buttons, drop-down list, and tree

view.Kendo UI widgets can be classified into three groups:

• Kendo UI Web• Kendo UI DataViz:• Kendo UI Mobile:

Complete list of kendo UI Widgets

Page 4: Introduction to Kendo Mobile Applications

Kendo UI Framework - 2.

Kendo UI Framework elementsThe Framework elements are the invisible entities which

helps in integrating the data with the widgets. DataSource Templates MVVM

Page 5: Introduction to Kendo Mobile Applications

First Kendo Mobile Application

Requirements • HTML Editor or IDE (Visual Studio, Dreamweaver or Notepad)• Kendo UI Bundle (javascript , stylesheets and images)• Jquery(the version of jQuery supported by the version of Kendo UI

Bundle you are using.)• Mobile Phone Emulator or Mobile Phone for testing.

Page 6: Introduction to Kendo Mobile Applications

Kendo Mobile Widgets

Views A view widget represents a page in a Kendo UI Mobile

application. All widgets and other HTML elements are added inside a view. Any Kendo UI Mobile app will have one or more views.

<div data-role=“view” id=“login-view” > Layout

A layout is nothing but a master template into which a view will be rendered.

<div data-role="layout" data-id="main-layout">

Page 7: Introduction to Kendo Mobile Applications

Kendo Mobile Widgets 2

Navigation Bara container widget where we can add a title and/or

other widgets E.g Menu items<div data-role="navbar">

Application Object var application = new kendo.mobile.Application();

Page 8: Introduction to Kendo Mobile Applications

DataSource

The DataSource plays a central role in the applications and sites built with Kendo UI. it provides commands to process local or remote data. retrieving data from a remote endpoint. It helps maintain the structure and type of the data it represents.var dataSource = new kendo.data.DataSource({ data: [ { id:1 , title: "Introduction To Kendo", category: 3 },

{ id: 2 , title: "MVC Jumpstart", category: 2 },{ id: 5 , title: "Design Patterns", category: 2 } ],

categories:[{ id:1 , name: "Design"},{ id:2 , name: "Web"},{ id:3 , name: "Mobile"}

] });

Page 9: Introduction to Kendo Mobile Applications

Templates

Templates are a simple and convenient way to build complex UI structures, typically with repeated blocks like the LIstView Widget.

1. #= lastName #: This renders the value stored in the variable lastName.2. #: address #: This renders the value with its HTML encoding.3. #for(... ){# ... #}#: This executes JavaScript code in the template so

that rendering happens depending on certain conditions, such as loops. #for(i=0;i<3; i++){#value of i: #=i# <br/> #}#

Page 10: Introduction to Kendo Mobile Applications

Templates – External Templates

External templates are defined in HTML files within <script> blocks with type text/x-kendo-template as shown:

<script id="kendoExternalTemplate" type="text/x-kendo-template" >

#for(i=0;i<3; i++){#value of i: #=i# <br/>

#}#</script>

Page 11: Introduction to Kendo Mobile Applications

MVVM

The process of using with Kendo MVVM is very simple. Here is what we

have to do: • Create an observable ViewModel from JavaScript data using

kendo.observable() • Bind the methods and properties in the ViewModel to HTML

elements in the UI using kendo.bind()

Page 12: Introduction to Kendo Mobile Applications