Exemple #1
0
            width: 68,
            height: 68
        }));

        return g;
    }
</script>

<?php 
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('index.php')->contentType('application/json')->type('POST');
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read($read);
$model = new \Kendo\Data\HierarchicalDataSourceSchemaModel();
$model->children("items");
$schema = new \Kendo\Data\HierarchicalDataSourceSchema();
$schema->model($model);
$dataSource = new \Kendo\Data\HierarchicalDataSource();
$dataSource->transport($transport)->schema($schema);
$layout = new \Kendo\Dataviz\UI\DiagramLayout();
$layout->type('layered');
$shape_defaults = new \Kendo\Dataviz\UI\DiagramShapeDefaults();
$shape_defaults->visual(new \Kendo\JavaScriptFunction('visualTemplate'))->editable(false)->rotatable(false)->resizable(false);
$stroke = new \Kendo\Dataviz\UI\DiagramConnectionDefaultsStroke();
$stroke->color('#979797')->width(2);
$connection_defaults = new \Kendo\Dataviz\UI\DiagramConnectionDefaults();
$connection_defaults->stroke($stroke);
$diagram = new \Kendo\Dataviz\UI\Diagram('diagram');
$diagram->dataSource($dataSource)->layout($layout)->shapeDefaults($shape_defaults)->connectionDefaults($connection_defaults);
echo $diagram->render();
?>
Exemple #2
0
	<strong>Inline data (default settings)</strong>	
	<?php 
$inlineDefault = new \Kendo\Data\HierarchicalDataSource();
$inlineDefault->data(array(array('text' => 'Furniture', 'items' => array(array('text' => 'Tables & Chairs'), array('text' => 'Sofas'), array('text' => 'Occasional Furniture'))), array('text' => 'Decor', 'items' => array(array('text' => 'Bed Linen'), array('text' => 'Curtains & Blinds'), array('text' => 'Carpets')))));
$treeviewLeft = new \Kendo\UI\TreeView('treeview-left');
$treeviewLeft->dataSource($inlineDefault);
echo $treeviewLeft->render();
?>
</div>

<div class="demo-section">
	<strong>Inline data</strong>	
	<?php 
$model = new \Kendo\Data\HierarchicalDataSourceSchemaModel();
$model->children("subCategories");
$schema = new \Kendo\Data\HierarchicalDataSourceSchema();
$schema->model($model);
$inline = new \Kendo\Data\HierarchicalDataSource();
$inline->schema($schema)->data(array(array('categoryName' => 'Storage', 'subCategories' => array(array('subCategoryName' => 'Wall Shelving'), array('subCategoryName' => 'Floor Shelving'), array('subCategoryName' => 'Kids Storage'))), array('categoryName' => 'Lights', 'subCategories' => array(array('subCategoryName' => 'Ceiling'), array('subCategoryName' => 'Table'), array('subCategoryName' => 'Floor')))));
$treeviewRight = new \Kendo\UI\TreeView('treeview-right');
$treeviewRight->dataSource($inline)->dataTextField(array('categoryName', 'subCategoryName'));
echo $treeviewRight->render();
?>
	
</div>

<style scoped>
	#example {
		text-align: center;
	}