or
<
div
id
=
"myList"
></
div
>
<
input
id
=
"toggleTime"
value
=
"Toggle Time Format"
onclick='toggleTimeFormat();" />
<
script
type
=
"text/javascript"
>
var myDataSource = new kendo.data.DataSource({
type: "json",
pageSize: 50,
transport: { read: "/myData/" }
});
var theGrid = $("#myList").kendoGrid({
scrollable: { virtual: true },
dataSource: myDataSource,
sortable: true,
height: 250,
columns: [
{ title: "Person", field: "CustomerName", sortable: true },
{ title: "Order Date", field: "OrderDate", sortable: true, template: '#= kendo.toString(convertToDate(OrderDate), "MM/dd/yyyy hh:mm tt") #' },
{ title: "Ship Date", field: "ShipDate", sortable: true, template: '#= kendo.toString(convertToDate(ShipDate), "MM/dd/yyyy hh:mm tt") #' }
]
});
function convertToDate(s) {
var dateRegExp = /^\/Date\((.*?)\)\/$/;
var date = dateRegExp.exec(s);
return new Date(parseInt(date[1]));
}
function toggleTimeFormat() {
// Update date values in the grid here
}
</
script
>
element.kendoMenu({
openOnClick:
true
});
<
div
class
=
"back-button-show"
data-role
=
"view"
data-layout
=
"app"
data-show
=
"getVendorDetails"
data-title
=
""
id
=
"vendor-details"
>
<
div
id
=
"vendor-detail-div"
>
<
div
id
=
"vendor-detail-name"
data-bind
=
"text: name"
></
div
>
<
div
id
=
"vendor-detail-tagline"
data-bind
=
"text: tag_line"
></
div
>
<
div
id
=
"vendor-detail-url"
data-bind
=
"text: url"
></
div
>
<
div
id
=
"vendor-detail-about"
data-bind
=
"text: about"
></
div
>
<
a
class
=
"button-left"
data-role
=
"button"
data-click
=
"addToFavoritesClick"
>Add to Favorites</
a
>
<
a
class
=
"button-right"
data-role
=
"button"
data-click
=
"addToContacts"
>Add to Contacts</
a
>
</
div
>
</
div
>
<
div
data-role
=
"layout"
data-id
=
"app"
data-show
=
"layoutShowInit"
>
<
header
data-role
=
"header"
>
<
div
data-role
=
"navbar"
>
<
a
class
=
"nav-button"
data-role
=
"backbutton"
data-align
=
"left"
>Back</
a
>
<
span
data-role
=
"view-title"
>Demo Conference</
span
>
</
div
>
</
header
>
<
footer
data-role
=
"footer"
>
<
div
data-role
=
"tabstrip"
>
<
a
href
=
"#main-page"
data-icon
=
"info"
>Info</
a
>
<
a
href
=
"#vendors"
data-icon
=
"organize"
>Vendors</
a
>
<
a
href
=
"#favorite-vendors"
data-icon
=
"favorites"
>Saved Vendors</
a
>
</
div
>
</
footer
>
</
div
>
<
script
>
var addToFavoritesClick = function(e) {
alert("This is a test");
};
</
script
>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
></
title
>
<
script
src
=
"../Scripts/jquery-1.7.1.min.js"
type
=
"text/javascript"
></
script
>
<
link
href
=
"../Styles/kendo.metro.min.css"
type
=
"text/css"
rel
=
"stylesheet"
/>
<
link
href
=
"../Styles/kendo.common.min.css"
type
=
"text/css"
rel
=
"stylesheet"
/>
<
script
src
=
"../Scripts/kendo.all.min.js"
type
=
"text/javascript"
></
script
>
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
$("#kendoDatePicker").kendoDatePicker();
});
</
script
>
</
head
>
<
body
>
<
form
id
=
"someform"
action
=
""
>
<
input
id
=
"kendoDatePicker"
type
=
"text"
/>
</
form
>
</
body
>
</
html
>
WebUtility.HtmlDecode(returnModel.TextValue);
[{"Microcampamento":{"id":"-1","mc_nombre":ninguno)",
"mc_calle_nombre":"","mc_calle_numero":"0","mc_comuna":"0","mc_anoest":"0000","mc_int_inicio":"0000-00-00","mc_int_fin":"0000-00-00","idfase":"0","mc_email_equipo":"nl","mc_comollegar":"null","mc_rasofac":"null","mc_bbdd":"null"}},{"Microcampamento":{"id":"1","mc_nombre":"4 Canchas","mc_calle_nombre":"Calle diecinueve","mc_calle_numero":"1118","mc_comuna":"118","mc_anoest":"2003","mc_int_inicio":"2010-01-01","mc_int_fin":"0000-00-00","idfase":"4","mc_email_equipo":"cnovoa@segen.cl","mc_comollegar":"null","mc_rasofac":"null","mc_bbdd":"null"}},
{"Microcampamento":{"id" ....and the other fields......}}]
ds=new kendo.data.DataSource({
transport:{
read:{
url:"/FTC/microcampamentos/crud",
dataType: "json",
complete: function(jqXHR, textStatus) {
console.log(textStatus, "read") }
}
},
update:{
url: "/FTC/microcampamentos/crud",
type: "POST",
complete: function(jqXHR, textStatus) {
console.log(textStatus, "update")
}
},
parameterMap: function(options, operation) {
},
change: function(){
console.log("Something happened!")
},
error: function() {
alert("Ha ocurrido un error al intentar conectar con la base de datos.");
},
schema: {
model:{
id:"Microcampamento.id",
fields:{
'Microcampamento.id': {editable:false},
'Microcampamento.mc_nombre': {editable:true},
'Microcampamento.mc_calle_nombre': {editable:true},
'Microcampamento.mc_calle_numero': {editable:true},
'Microcampamento.mc_comuna': {editable:true},
'Microcampamento.mc_anoest': {editable:true},
'Microcampamento.mc_int_inicio': {editable:true},
'Microcampamento.mc_int_fin': {editable:true},
'Microcampamento.idfase': {editable:true},
'Microcampamento.mc_email_equipo': {editable:true},
'Microcampamento.mc_comollegar': {editable:true},
'Microcampamento.mc_rasofac': {editable:true},
'Microcampamento.mc_bbdd': {editable:true}
}
}
},
pageSize:10
});
$(document).ready(function(){
//KendoGrid para Microcampamentos
$("#mc_grid").kendoGrid({
dataSource:ds,
height: 370,
scrollable:false,
sortable: true,
pageable: true,
editable: true,
navigatable: true,
toolbar: ["create", "save", "cancel","destroy"],
columns: [
{field: "Microcampamento.id", title: "ID"},
{field: "Microcampamento.mc_nombre", title: "Nombre"},
{field: "Microcampamento.mc_calle_nombre", title: "Calle"},
{field: "Microcampamento.mc_calle_numero", title: "Número"},
{field: "Microcampamento.mc_comuna", title: "Comuna"},
{field: "Microcampamento.mc_anoest", title: "Año Est."},
{field: "Microcampamento.mc_int_inicio", title: "Inicio Interv."},
{field: "Microcampamento.mc_int_fin", title: "Fin Interv."},
{field: "Microcampamento.idfase", title: "Fase", width: '100px'},
{field: "Microcampamento.mc_email_equipo", title: "Email Equipo"},
{field: "Microcampamento.mc_comollegar", title: "Cómo Llegar", template:'<
a
href
=
""
>IR</
a
>'},
{field: "Microcampamento.mc_rasofac", title: "Rasofac"},
{field: "Microcampamento.mc_bbdd", title: "BBDD"}
]
})
});