<?php require_once '../lib/DataSourceResult.php'; require_once '../lib/Kendo/Autoload.php'; require_once '../include/header.php'; ?> <div class="demo-section k-rtl"> <h2>Select Continents</h2> <?php $multiselect = new \Kendo\UI\MultiSelect('select'); $multiselect->dataTextField('text')->dataValueField('value')->dataSource(array(array('text' => 'Africa', 'value' => '1'), array('text' => 'Europe', 'value' => '2'), array('text' => 'Asia', 'value' => '3'), array('text' => 'North America', 'value' => '4'), array('text' => 'South America', 'value' => '5'), array('text' => 'Antarctica', 'value' => '6'), array('text' => 'Australia', 'value' => '7'))); echo $multiselect->render(); ?> <style scoped> .demo-section { width: 250px; margin: 35px auto 50px; padding: 30px; } .demo-section h2 { text-transform: uppercase; font-size: 1.2em; margin-bottom: 10px; } </style> </div> <?php require_once '../include/footer.php';
<?php require_once '../lib/DataSourceResult.php'; require_once '../lib/Kendo/Autoload.php'; require_once '../include/header.php'; $multiselect = new \Kendo\UI\MultiSelect('select'); $multiselect->dataTextField('text')->dataValueField('value')->dataSource(array(array('text' => 'Africa', 'value' => '1'), array('text' => 'Europe', 'value' => '2'), array('text' => 'Asia', 'value' => '3'), array('text' => 'North America', 'value' => '4'), array('text' => 'South America', 'value' => '5'), array('text' => 'Antarctica', 'value' => '6'), array('text' => 'Australia', 'value' => '7')))->select('onSelect')->dataBound('onDataBound')->change('onChange')->close('onClose')->open('onOpen'); ?> <div class="demo-section"> <h3 class="title">Select Continents</h3> <?php echo $multiselect->render(); ?> </div> <script> function onOpen() { if ("kendoConsole" in window) { kendoConsole.log("event: open"); } } function onDataBound(){ if ("kendoConsole" in window) { kendoConsole.log("event: dataBound"); } } function onClose() { if ("kendoConsole" in window) {
</li> </ul> </div> <div class="config-section"> <span class="configHead">Select</span> <ul class="options"> <li> <input id="value" value="1,2" class="k-textbox" style="width: 40px; margin: 0;" /> <button id="setValue" class="k-button">Select by value</button> </li> </ul> </div> </div> <div class="demo-section"> <?php $multiselect = new \Kendo\UI\MultiSelect('movies'); $multiselect->dataTextField('text')->dataValueField('value')->dataSource(array(array('text' => '12 Angry Men', 'value' => 1), array('text' => 'Il buono, il brutto, il cattivo.', 'value' => 2), array('text' => 'Inception', 'value' => 3), array('text' => "One Flew Over the Cuckoo's Nest", 'value' => 4), array('text' => 'Pulp Fiction', 'value' => 5), array('text' => "Schindler's List", 'value' => 6), array('text' => 'The Dark Knight', 'value' => 7), array('text' => 'The Godfather', 'value' => 8), array('text' => 'The Godfather: Part II', 'value' => 9), array('text' => 'The Shawshank Redemption', 'value' => 10), array('text' => 'The Shawshank Redemption 2', 'value' => 11))); echo $multiselect->render(); ?> </div> <script> $(function() { $("#filter").kendoDropDownList({ change: filterTypeOnChanged }); var multiselect = $("#movies").data("kendoMultiSelect"), setValue = function (e) { if (e.type != "keypress" || kendo.keys.ENTER == e.keyCode) { multiselect.dataSource.filter({}); //clear applied filter before setting value multiselect.value($("#value").val().split(","));