Hello I'm David. I have a problem with scheduler. I have a web service json with the following information.
[{"id":"1","start":"2016\/05\/20 08:00 AM","end":"2016\/05\/20 08:00 AM","isAllDay":true,"title":"PRUEBA DIGITALIZACION","description":"C000001"},{"id":"2","start":"2016\/05\/20 08:00 AM","end":"2016\/05\/20 08:00 AM","isAllDay":true,"title":"uno","description":"C000002"},{"id":"3","start":"2016\/05\/20 08:00 AM","end":"2016\/05\/20 08:00 AM","isAllDay":true,"title":"uno","description":"C000003"}]
and do not know how to put it into my schedule scheduler on the corresponding dates . Deputy code if anyone can help me please.
// agenda.php
<html>
<head>
<meta charset="utf-8">
<link href="../../system/telerik/content/shared/styles/examples-offline.css" rel="stylesheet" type="text/css"/>
<link href="../../system/telerik/styles/kendo.common.min.css" rel="stylesheet" type="text/css"/>
<link href="../../system/telerik/styles/kendo.rtl.min.css" rel="stylesheet" type="text/css"/>
<link href="../../system/telerik/styles/kendo.default.min.css" rel="stylesheet" type="text/css"/>
<link href="../../system/telerik/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css"/>
<link href="../../system/telerik/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css"/>
<script src="../../system/telerik/js/jquery.min.js" type="text/javascript"></script>
<script src="../../system/telerik/js/jszip.min.js" type="text/javascript"></script>
<script src="../../system/telerik/js/kendo.all.min.js" type="text/javascript"></script>
<script src="../../system/telerik/content/shared/js/console.js" type="text/javascript"></script>
<script>
</script>
</head>
<body>
<div id="example" class="k-content">
<!--[if gte IE 9]>-->
<div id="team-schedule">
<div id="people">
<input checked type="checkbox" id="alex" value="1">
<input checked type="checkbox" id="bob" value="2">
<input type="checkbox" id="charlie" value="3">
</div>
</div>
<div id="scheduler"></div>
<script src="../../system/telerik/content/shared/js/everlive.all.js" type="text/javascript"></script>
<script>
// initialize Backend Services (Everlive) application with application API key
var dataSource = new kendo.data.SchedulerDataSource({
transport: {
read: {
url: "service.php",// my web service
dataType: "jsonp"
} } });
$("#scheduler").kendoScheduler({
date: new Date("2016/05/20"),
views: ["day", "month"],
dataSource: [
{ id: 1,
start: new Date("2016/05/20 08:00 AM"),
end: new Date("2016/05/20 09:00 AM"),
isAllDay: true,
title: "hola jorge",
description: "lo que sea"
} ],
edit: function (e) {
console.log("Editing", e.event.title);
}
});
</script>
</div>
<style>
.k-nav-current > .k-link span + span {
max-width: 200px;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
vertical-align: top;
}
#team-schedule {
background: url('../../system/telerik/content/web/scheduler/team-schedule.png') transparent no-repeat;
height: 115px;
position: relative;
}
#people {
background: url('../../system/telerik/content/web/scheduler/scheduler-people.png') no-repeat;
width: 345px;
height: 115px;
position: absolute;
right: 0;
}
#alex {
position: absolute;
left: 4px;
top: 81px;
}
#bob {
position: absolute;
left: 119px;
top: 81px;
}
#charlie {
position: absolute;
left: 234px;
top: 81px;
}
</style>
</body>
</html>
// end agenda.php
//start service.php
<?php
include("clase_principal.php");
$frame = new frames();
$query = "SELECT doc_documentos_id,fecha_creacion,fecha_creacion, "
. "titulo,codigo_documento FROM "
. "doc_documentos limit 3";
$matriz_documentos = $db_obj->ejecutar_consulta($query);
foreach ($matriz_documentos as $registro) {
$tmpMatriz = Array(
"id" => $registro[0],
"start" => "2016-05-20 09:00:00",
"end" =>"2016-05-20 09:00:00",
"isAllDay" => true,
"title" => $registro[3],
"description" => $registro[4]
);
$retorno[] = $tmpMatriz;
}
$Json_telerik = json_encode($retorno);
echo $Json_telerik;
Hello Support,
Our Analysis Server based on user groups which have different access rights like Country etc.
If we add a dimension to the pivot grid, only the allowed values will be displayed.
Example: German User is only able to the the figures from germany!
Now, the user want activate a filter on this level "filter --> includes fields" and all available Countries will be displayed.
Is it possible to reduce the filter option to the allowed countries. This effect belongs to each dimension within the pivot grid.
Thanks for your support!
Boris
Hi there
I was trying to reproduce the Demo: http://demos.telerik.com/php-ui/grid/foreignkeycolumn
After carefully writing the code almost exactly as the Demo in my TestPage.php (just changing database Fields and Connections), and including the DataSourceResult.php exactly as the demo, it still came with 2 bugs:
1) When the grid renders, it successfully brings the Database Data, but the Dropdown list doesn't show anything in it's Field. And it comes blank.
2) When you click in the Dropdown list it successfully shows the CategoryNames, but when you choose one of then, it also doesn't work, probably it's because it's trying to update with a Text in a Number field. And of course, it doesn't update in the database as well.
I've attached a screenshot to show each situation described above. Also, below it goes the code used in the TestPage.php.
Could you please give me a hand to check what's wrong with the code to fix these 2 bugs?
Thanks and waiting yours.
<?php
require $_SERVER['DOCUMENT_ROOT'] . '/lib/Kendo/Autoload.php';
require $_SERVER['DOCUMENT_ROOT'] . '/lib/DataSourceResult.php';
?>
<?php
$result = new DataSourceResult('mysql:host=localhost;dbname=db', 'user', '******'); //ok
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
header('Content-Type: application/json');
$request = json_decode(file_get_contents('php://input'));
$type = $_GET['type'];
$columns = array('PKEntrada', 'Descricao', 'Valor', 'FKCategoriaEntrada');
switch($type) {
case 'create':
$result = $result->create('tblentradas', $columns, $request->models, 'PKEntrada');
break;
case 'read':
$result = $result->read('tblentradas', $columns, $request);
break;
case 'update':
$result = $result->update('tblentradas', $columns, $request->models, 'PKEntrada');
break;
case 'destroy':
$result = $result->destroy('tblentradas', $request->models, 'PKEntrada');
break;
}
echo json_encode($result);
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="styles/kendo.common.min.css" />
<link href="styles/kendo.bootstrap.min.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script src="js/kendo.all.min.js"></script>
</head>
<body>
<?php
$categories = $result->read('tblcategoriasentrada', array('PKCategoriaEntrada as value', 'Categoria as text'));
$transport = new \Kendo\Data\DataSourceTransport();
$create = new \Kendo\Data\DataSourceTransportCreate();
$create->url('TestPage.php?type=create')
->contentType('application/json')
->type('POST');
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('TestPage.php?type=read')
->contentType('application/json')
->type('POST');
$update = new \Kendo\Data\DataSourceTransportUpdate();
$update->url('TestPage.php?type=update')
->contentType('application/json')
->type('POST');
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
$destroy->url('TestPage.php?type=destroy')
->contentType('application/json')
->type('POST');
$transport->create($create)
->read($read)
->update($update)
->destroy($destroy)
->parameterMap('function(data) {
return kendo.stringify(data);
}');
$model = new \Kendo\Data\DataSourceSchemaModel();
$productIDField = new \Kendo\Data\DataSourceSchemaModelField('PKEntrada');
$productIDField->type('number')
->editable(false)
->nullable(true);
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('Descricao');
$productNameField->type('string')
->validation(array('required' => true));
$unitPriceValidation = new \Kendo\Data\DataSourceSchemaModelFieldValidation();
$unitPriceValidation->required(true)
->min(1);
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('Valor');
$unitPriceField->type('number')
->validation($unitPriceValidation);
$categoryIDField = new \Kendo\Data\DataSourceSchemaModelField('FKCategoria');
$categoryIDField->type('number');
$model->id('PKEntrada')
->addField($productIDField)
->addField($productNameField)
->addField($unitPriceField)
->addField($categoryIDField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')
->errors('errors')
->model($model)
->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)
->batch(true)
->pageSize(30)
->schema($schema);
$grid = new \Kendo\UI\Grid('grid');
$productName = new \Kendo\UI\GridColumn();
$productName->field('Descricao')
->title('Description');
$unitPrice = new \Kendo\UI\GridColumn();
$unitPrice->field('Valor')
->format('{0:c}')
->width(200)
->title('Value');
$categoryID = new \Kendo\UI\GridColumn();
$categoryID->field('FKCategoria')
->title('FKCategory')
->values($categories['data'])
->width(200);
$command = new \Kendo\UI\GridColumn();
$command->addCommandItem('destroy')
->title(' ')
->width(150);
$grid->addColumn($productName, $categoryID, $unitPrice, $command)
->dataSource($dataSource)
->addToolbarItem(new \Kendo\UI\GridToolbarItem('create'),
new \Kendo\UI\GridToolbarItem('save'), new \Kendo\UI\GridToolbarItem('cancel'))
->height(540)
->navigatable(true)
->editable(true)
->groupable(true)
->pageable(true);
echo $grid->render();
?>
</body>
</html>
Hi Telerik Team,
is it possible to supress a direct grid refresh, when a dimension was added to the grid.
I need to define my "pivot" row`s and column`s without getting the data directly from analysis service.
Regards
Boris
Hello,
I'm new to Kendo and been working on Grids.
I set up a grid with grouping but, I need to set a default group.
I have these headers year, type, id, title, date and I will want the default group to be by type.
I seen a few ways on the site to do it by JS but, is there an easier, php way to do this maybe through addColumn -> datasource or by $grid->dataBound.
Thanks a lot,
Brett
I am looking for any example code on how to make a master detail with combobox and a grid so when selected item in a combo box changes the grid also changes its data from mysql database, so any example ?
I followed the code in this example http://demos.telerik.com/php-ui/grid/editing-inline but although the grid appear bit there is no data inside it. Here is the code attached
I debugged the first part of the code and found the code connect successfully to my db and return the number of rows successfully. please advise what is the problem that prevent data to appear.