Пример #1
0
    <h2>Customize your Kendo T-shirt</h2>
    <img id="tshirt" src="../content/web/combobox/tShirt.png" />
    <div id="options">
        <h3>T-shirt Fabric</h3>
<?php 
$fabrics = new \Kendo\Data\DataSource();
$fabrics->data(array(array('text' => 'Cotton', 'value' => 1), array('text' => 'Polyester', 'value' => 2), array('text' => 'Cotton/Polyester', 'value' => 3), array('text' => 'Rib Knit', 'value' => 4)));
$input = new \Kendo\UI\ComboBox('fabric');
$input->dataSource($fabrics)->dataTextField('text')->dataValueField('value')->filter('contains')->placeholder('Select fabric ...')->suggest(true)->index(3);
echo $input->render();
?>
        <h3>T-shirt Size</h3>
<?php 
$select = new \Kendo\UI\ComboBox('size');
$select->dataSource(array('X-Small', 'Small', 'Medium', 'Large', 'X-Large', '2X-Large'))->placeholder('Select size ...')->index(0);
echo $select->render();
?>
        <button class="k-button" id="get">Customize</button>
    </div>
</div>
<style scoped>
#example h2 {
    font-weight: normal;
}
#tshirt-view {
    border-radius: 10px 10px 10px 10px;
    border-style: solid;
    border-width: 1px;
    overflow: hidden;
    width: 500px;
    margin: 30px auto;
Пример #2
0
<?php

require_once '../lib/DataSourceResult.php';
require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
?>
<div class="demo-section">
    <h3>T-shirt Size</h3>
<?php 
$comboBox = new \Kendo\UI\ComboBox('select');
$comboBox->placeholder('Select size ...')->attr('style', 'width: 200px')->attr('accesskey', 'w')->value('Large')->dataSource(array('X-Small', 'Small', 'Medium', 'Large', 'X-Large', '2X-Large'));
echo $comboBox->render();
?>
</div>

<ul class="keyboard-legend">
    <li>
        <span class="button-preview">
            <span class="key-button leftAlign wider"><a target="_blank" href="http://en.wikipedia.org/wiki/Access_key">Access key</a></span>
            +
            <span class="key-button">w</span>
        </span>
        <span class="button-descr">
            focuses the widget
        </span>
    </li>
</ul>

<ul class="keyboard-legend">
    <li>
        <span class="button-preview">
Пример #3
0
<?php 
$read->url('cascadingcombobox.php?type=products');
$transport->read($read);
$products = new \Kendo\UI\ComboBox('products');
$products->dataSource(array('transport' => $transport, 'schema' => $schema, 'serverFiltering' => true))->autoBind(false)->cascadeFrom('categories')->dataTextField('ProductName')->dataValueField('ProductID')->attr('style', 'width:300px')->filter('contains')->placeholder('Select product ...');
echo $products->render();
?>
    </p>
    <p>
        <label for="orders">Orders:</label>
<?php 
$read->url('cascadingcombobox.php?type=orders');
$transport->read($read);
$products = new \Kendo\UI\ComboBox('orders');
$products->dataSource(array('transport' => $transport, 'schema' => $schema, 'serverFiltering' => true))->autoBind(false)->cascadeFrom('products')->dataTextField('OrderID')->dataValueField('OrderID')->attr('style', 'width:300px')->filter('contains')->placeholder('Select order ...');
echo $products->render();
?>
    </p>
    <button class="k-button" id="get">View Order</button>
</div>
<script>
    $(document).ready(function () {
        var categories = $("#categories").data("kendoComboBox"),
            products = $("#products").data("kendoComboBox"),
            orders = $("#orders").data("kendoComboBox");

        $("#get").click(function () {
            var categoryInfo = "\nCategory: { id: " + categories.value() + ", name: " + categories.text() + " }",
                productInfo = "\nProduct: { id: " + products.value() + ", name: " + products.text() + " }",
                orderInfo = "\nOrder: { id: " + orders.value() + ", name: " + orders.text() + " }";