or
<
div
id
=
"domSelection"
style
=
"width:620px; height:300px"
></
div
>
<
script
>
$(document).ready(function() {
$("#domSelection").kendoGrid({
dataSource: {
data: addItems(),
},
selectable: "multiple",
pageable: true,
scrollable: true,
navigatable: true,
columns: [
{ field: "FirstName", title: "name", format: "{0:c}", type:"String",editable: false, width: "150px" },
{ field: "add"
, title: "add", width: "120px" }
],
editable: false
});
$('#aƱadir').click(function () {
var sourcegrid = $('#domSelection').data('kendoGrid'); //SOURCE GRID
var destinationgrid = $('#Selection').data('kendoGrid'); // DESTINATION GRID
sourcegrid.select().each(function () {
var dataItem = sourcegrid.dataItem($(this));
var column = dataItem.FirstName; // whatever the name of the unique id for your data source
alert(column);
destinationgrid.dataSource.add(dataItem); // DESTINATION DATASOURCE
});
destinationgrid.refresh(); // MUST REFRESH THE DESTINATION GRID
});
});
</
script
>
<
div
id
=
"Selection"
style
=
"width:600px;"
></
div
>
<
script
>
$(document).ready(function() {
$("#Selection").kendoGrid({
dataSource: {
},
selectable: "multiple",
pageable: true,
scrollable: true,
navigatable: true,
columns: [
{ field: "FirstName", title: "name", format: "{0:c}", type:"String",editable: false, width: "150px" },
{ field: "City", title: "city", editable:true, type:"Number", validation: { min: 1, required: true },width: "150px" },
{field: "BirthDate", title: "date", type:"String", editable: true, width:"150px"},
{ command: ["edit", "destroy"], title: "Editar", width: "210px" }],
editable: true
});
});
</
script
>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
>My Open Cal</
title
>
<!-- Kendo UI Files -->
<
link
href
=
"styles/kendo.mobile.all.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
src
=
"js/jquery.min.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"js/kendo.mobile.min.js"
type
=
"text/javascript"
></
script
>
<
script
>
var twitterDataSource;
$( //jQuery page load
function ()
{
var app = new kendo.mobile.Application($(document.body), { layout: "layout", icon: "/images/xboxavatar.png" });
})
function setupListView()
{
twitterDataSource = new kendo.data.DataSource(
{
transport:
{
read:
{
contentType: "application/json; charset=utf-8",
type: "GET",
dataType: "jsonp",
data:
{
q: "#tampa"
}
}
},
schema:
{
data: "results"
}
})
$("#ulMyCal").kendoMobileListView({
pullToRefresh: true,
appendOnRefresh: true,
dataSource: twitterDataSource,
template: "<
p
>${text}</
p
>"
});
}
</
script
>
</
head
>
<
body
>
<!-- Layout for all views in the application, as specified when the app is created -->
<
div
data-role
=
"layout"
data-id
=
"layout"
>
<
div
data-role
=
"header"
>
<
div
data-role
=
"navbar"
>
<
span
data-role
=
"view-title"
>My Open Cal</
span
>
</
div
>
</
div
>
<
div
data-role
=
"footer"
>
<
div
data-role
=
"tabstrip"
>
<
a
href
=
"#index"
data-icon
=
"organize"
>My Calendar</
a
>
<
a
href
=
"#search"
data-icon
=
"search"
>Search</
a
>
<
a
href
=
"settings.htm"
data-icon
=
"settings"
>Settings</
a
>
</
div
>
</
div
>
</
div
>
<
div
data-role
=
"view"
id
=
"index"
data-title
=
"My Calendar"
data-init
=
"setupListView"
<div
style
=
"text-align:center"
>
<
ul
id
=
"ulMyCal"
data-style
=
"inset"
>
</
ul
>
</
div
>
</
div
>
<
div
data-role
=
"view"
id
=
"search"
data-title
=
"Search"
>
</
div
>
</
body
>
</
html
>
var
projects =
new
kendo.data.DataSource({
type:
"odata"
,
transport: { read:
"http://localhost:50486/WcfDataService.svc/Projects"
}
});
$(
"#projectsListView"
).kendoMobileListView({
dataSource: projects,
style :
"inset"
,
template:
"${Number} - ${Label}"
,
});
$(
"#projectsListView"
).kendoMobileListView();
var
lv = $(
"#projectsListView"
).data(
"kendoMobileListView"
);
lv.options.template =
"${Number} - ${Label}"
;
lv.options.style =
"inset"
;
lv.dataSource = projects;
lv.refresh();