or
$studs = array();
$db->query("SET CHARACTER SET utf8");
$students = $db->get_results("SELECT * FROM tbl_participants");
if(!empty($students)){
foreach($students as $k=>$v){
$studs['participant'][] = $v->participant;
}
}
echo json_encode($studs);
<
script
>
$(document).ready(function() {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "fetch_data.php",
dataType: "json"
}
},
schema: {data: "participant"}
});
$("#grid").kendoGrid({
dataSource: dataSource,
height: 360,
groupable: true,
scrollable: true,
sortable: true,
pageable: true,
autoBind:true,
columns: [
{field: 'participant', title: 'Name'}
]
});
});
</
script
>
<
table
id
=
"grid"
></
table
>
dataSource.filter([
{ field:
"orderId"
, operator:
"neq"
, value: 42 },
{ field:
"unitPrice"
, operator:
"ge"
, value: 3.14 }
]);
filter[filters][]
filter[filters][0][field]
filter[filters][0][operator]
filter[filters][0][value]
$(
"#grid"
).kendoGrid({
dataSource: {
type:
"json"
,
transport: {
read: {
dataType:
"json"
,
type:
"POST"
},
parameterMap:
function
(options) {
return
JSON.stringify({
"serviceName"
:
"ActoresPublicoService"
,
"methodName"
:
"getPaises"
,
"parameters"
: []});
}
},
schema: {
model: {
fields: {
title: { type:
"string"
}
}
}
}
},
height: 250,
filterable:
true
,
sortable:
true
,
pageable:
true
,
});
var
selectedActivity;
var
activityModel = kendo.data.Model.define({
id:
"_id"
,
fields: {
_id : {type:
"string"
},
date: {type:
"string"
},
activity : {type:
"string"
},
hours : {type:
"number"
}
}
});
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
'/activity'
,
contentType:
'application/json; charset=utf-8'
,
type:
'GET'
,
dataType:
'json'
},
destroy: {
url:
'/activity'
,
type:
'DELETE'
,
dataType:
'json'
},
update: {
url:
'/activity'
,
type:
'PUT'
,
dataType:
'json'
},
},
schema:{
model: activityModel
}
});
$(
"#grid"
).kendoGrid({
dataSource: dataSource,
sortable:
true
,
selectable:
true
,
rowTemplate: kendo.template($(
"#rowTemplate"
).html()),
altRowTemplate: kendo.template($(
"#altRowTemplate"
).html()),
columns: [
{field:
"_id"
, title:
"id"
},
{field:
"date"
, title:
"date"
},
{field:
"activity"
, title:
"activity"
},
{field:
"hours"
, title:
"hours"
}
],
change:
function
(){
var
selectedId =
this
.select().data(
"id"
);
selectedActivity =
this
.dataSource.get(selectedId);
console.log(
"selected id:"
+selectedId)
console.log(
"selected activity is:"
+JSON.stringify(selectedActivity));
}
});
var
data = {
"Title"
:
"Title of chart"
,
"Series"
: [
{
"Name"
:
"2015"
,
"Values"
: [1.00, 0, 0, 2.00]
},
{
"Name"
:
"2016"
,
"Values"
: [1.30, 0.5, 0.6, 2.50]
}
],
"XAxis"
:
{
"Values"
: [
"20 févr."
,
"21 févr."
,
"22 févr."
,
"23 févr."
]
}
};
<
div
id
=
"tabstrip"
>
<
ul
>
<
li
class
=
"k-state-active"
>
Movies
</
li
>
<
li
>
Series
</
li
>
</
ul
>
<
div
>
<
div
id
=
"gridMovies"
/>
<
div
>
Second Tab Content
</
div
>
</
div
>
<div id="gridMovies"></div>it works fine.