예제 #1
0
            </dl>
        </div>
    </script>

<div class="demo-section">
    <a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>Add new record</a>
</div>

<div class="demo-section">
<?php 
$transport = new \Kendo\Data\DataSourceTransport();
$create = new \Kendo\Data\DataSourceTransportCreate();
$create->url('navigation.php?type=create')->contentType('application/json')->type('POST');
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('navigation.php?type=read')->contentType('application/json')->type('POST');
$update = new \Kendo\Data\DataSourceTransportUpdate();
$update->url('navigation.php?type=update')->contentType('application/json')->type('POST');
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
$destroy->url('navigation.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('ProductID');
$productIDField->type('number')->editable(false)->nullable(true);
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string');
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number');
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
예제 #2
0
function create_makerfaire_scheduler($faire_id)
{
    $transport = new \Kendo\Data\DataSourceTransport();
    $create = new \Kendo\Data\DataSourceTransportCreate();
    $create->url('makerfaire-scheduling-tasks.php?type=create')->contentType('application/json')->type('POST')->dataType('json');
    $read = new \Kendo\Data\DataSourceTransportRead();
    $read->url('makerfaire-scheduling-tasks.php?type=read')->contentType('application/json')->type('GET')->dataType('json');
    $update = new \Kendo\Data\DataSourceTransportUpdate();
    $update->url('makerfaire-scheduling-tasks.php?type=update')->contentType('application/json')->type('POST')->dataType('json');
    $destroy = new \Kendo\Data\DataSourceTransportDestroy();
    $destroy->url('makerfaire-scheduling-tasks.php?type=destroy')->contentType('application/json')->type('POST')->dataType('json');
    $transport->create($create)->read($read)->update($update)->destroy($destroy)->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
    $model = new \Kendo\Data\DataSourceSchemaModel();
    $locationIdField = new \Kendo\Data\DataSourceSchemaModelField('locationID');
    $locationIdField->type('number')->from('locationID')->nullable(true);
    $titleField = new \Kendo\Data\DataSourceSchemaModelField('title');
    $titleField->from('Title')->defaultValue('No title')->validation(array('required' => false));
    $startField = new \Kendo\Data\DataSourceSchemaModelField('start');
    $startField->type('date')->from('Start');
    $endField = new \Kendo\Data\DataSourceSchemaModelField('end');
    $endField->type('date')->from('End');
    $isAllDayField = new \Kendo\Data\DataSourceSchemaModelField('isAllDay');
    $isAllDayField->type('boolean')->from('IsAllDay');
    $subareaIdField = new \Kendo\Data\DataSourceSchemaModelField('subareaId');
    $subareaIdField->from('SubareaID')->nullable(true);
    $entriesField = new \Kendo\Data\DataSourceSchemaModelField('entries');
    $entriesField->from('Entries')->nullable(true);
    $model->id('locationID')->addField($locationIdField)->addField($titleField)->addField($startField)->addField($endField)->addField($isAllDayField)->addField($subareaIdField)->addField($entriesField);
    $schema = new \Kendo\Data\DataSourceSchema();
    $schema->model($model);
    $dataSource = new \Kendo\Data\DataSource();
    $dataSource->transport($transport)->schema($schema)->batch(false);
    $subareasResource = new \Kendo\UI\SchedulerResource();
    $locations_array = get_entry_locations($faire_id);
    $subareasResource->field('subareaId')->title('Stage')->name('Stages')->dataSource($locations_array);
    $entries = get_entries($faire_id);
    $entriesResource = new \Kendo\UI\SchedulerResource();
    $entriesResource->field('entries')->title('Presenter')->multiple(true)->name('Presenters')->dataSource($entries);
    $pdf = new \Kendo\UI\SchedulerPdf();
    $pdf->fileName('Kendo UI Scheduler Export.pdf')->proxyURL('makerfaire-scheduling.php?type=save');
    $scheduler = new \Kendo\UI\Scheduler('scheduler');
    $scheduler->eventTemplateId('presentation-template')->timezone('UTC')->currentTimeMarker(false)->date(new DateTime('2015/9/26 00:00', new DateTimeZone('UTC')))->height(900)->pdf($pdf)->addToolbarItem(new \Kendo\UI\SchedulerToolbarItem('pdf'))->addResource($subareasResource, $entriesResource)->group(array('resources' => array('Stages')))->addView(array('type' => 'day', 'majorTick' => 30, 'showWorkHours' => true, 'workWeekEnd' => 7, 'workDayStart' => new DateTime('2015/1/1 15:00', new DateTimeZone('UTC')), 'workDayEnd' => new DateTime('2015/1/1 24:00', new DateTimeZone('UTC'))), array('type' => 'workWeek', 'majorTick' => 30, 'selected' => true, 'workWeekStart' => 5, 'workWeekEnd' => 7, 'showWorkHours' => true, 'workDayStart' => new DateTime('2015/1/1 15:00', new DateTimeZone('UTC')), 'workDayEnd' => new DateTime('2015/1/1 24:00', new DateTimeZone('UTC'))), 'agenda')->dataSource($dataSource);
    return $scheduler;
}
<?php

require_once 'lib/Kendo/Autoload.php';
include 'header.php';
// --------- Kendo UI DataSource Transport -------
$create = new \Kendo\Data\DataSourceTransportCreate();
$create->url('/api/products/create.php')->contentType('application/json')->type('POST');
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('/api/products/read.php')->contentType('application/json')->type('POST');
$update = new \Kendo\Data\DataSourceTransportUpdate();
$update->url('/api/products/update.php')->contentType('application/json')->type('PUT');
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
$destroy->url('/api/products/destroy.php')->contentType('application/json')->type('POST');
$transport = new \Kendo\Data\DataSourceTransport();
$transport->create($create)->read($read)->update($update)->destroy($destroy)->parameterMap('function(data) { return kendo.stringify(data); }');
// --------- Kendo UI DataSource Schema -------
$model = new \Kendo\Data\DataSourceSchemaModel();
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string');
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number');
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
$supplierField = new \Kendo\Data\DataSourceSchemaModelField("Supplier");
$supplierField->defaultValue(new stdClass());
$categoryField = new \Kendo\Data\DataSourceSchemaModelField("Category");
$categoryField->defaultValue(new stdClass());
$model->id("ProductID")->addField($productNameField)->addField($unitPriceField)->addField($unitsInStockField)->addField($supplierField)->addField($categoryField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
// --------- Kendo UI DataSource -------
예제 #4
0
파일: tree.php 프로젝트: mirkoargentino/bbn
 public function set_update($url)
 {
     $dst = new \Kendo\Data\DataSourceTransportUpdate();
     $dst->url('json/update/' . $url)->contentType('application/json')->type('POST');
     $this->grid->transport->update($dst);
 }
            $result = $result->destroyWithAssociation('Meetings', 'MeetingAttendees', $request->models, 'MeetingID');
            break;
        default:
            $result = $result->readWithAssociation('Meetings', 'MeetingAttendees', 'MeetingID', array('AttendeeID' => 'Attendees'), array('MeetingID', 'RoomID'), $request);
            break;
    }
    echo json_encode($result, JSON_NUMERIC_CHECK);
    exit;
}
require_once '../include/header.php';
$transport = new \Kendo\Data\DataSourceTransport();
$create = new \Kendo\Data\DataSourceTransportCreate();
$create->url('resources-grouping-horizontal.php?type=create')->contentType('application/json')->type('POST');
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('resources-grouping-horizontal.php?type=read')->contentType('application/json')->type('POST');
$update = new \Kendo\Data\DataSourceTransportUpdate();
$update->url('resources-grouping-horizontal.php?type=update')->contentType('application/json')->type('POST');
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
$destroy->url('resources-grouping-horizontal.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();
$meetingIdField = new \Kendo\Data\DataSourceSchemaModelField('meetingID');
$meetingIdField->type('number')->from('MeetingID')->nullable(true);
$titleField = new \Kendo\Data\DataSourceSchemaModelField('title');
$titleField->from('Title')->defaultValue('No title')->type('string')->validation(array('required' => true));
$startField = new \Kendo\Data\DataSourceSchemaModelField('start');
$startField->type('date')->from('Start');
$startTimezoneField = new \Kendo\Data\DataSourceSchemaModelField('startTimezone');
$startTimezoneField->from('StartTimezone');
예제 #6
0
파일: grid.php 프로젝트: mirkoargentino/bbn
 public function set_update($url)
 {
     if (isset($this->transport)) {
         $this->_update = 1;
         $dst = new \Kendo\Data\DataSourceTransportUpdate();
         $dst->url($url)->type('POST');
         $this->transport->update($dst);
     }
 }