or
<!DOCTYPE html><html> <head> <title>Test</title> <script src="source/jquery.min.js"></script> <script src="source/kendo.all.js"></script> <script src="scripts.js"></script> <link href="styles/kendo.common.min.css" rel="stylesheet" /> <link href="styles/kendo.default.min.css" rel="stylesheet" /> </head> <body> <div class="main"> <div class="header"> <img src="styles/image/kendo-logo-big.png" class="logo" /> <h1>Kendo UI Grid</h1> </div> <div id="grid"> <table id="weapons"> <tr> <th data-field="name">Name</th> <th data-field="desc">Description</th> </tr> </table> </div> </div> </body></html>$(document).ready(function() { dataSource = new kendo.data.DataSource({ transport: { read: { url: "http://dhpl.comuf.com/json.php", dataType: "json" } }, schema: { data: "results" } }); $("#weapons").kendoGrid({ dataSource: dataSource });});<?php header("Content-type: application/json"); print('{ "results" : [{ "name" : "Name1", "desc" : "Desc1" }, { "name" : "Name2", "desc" : "Desc2" }] } ');?>
Url http://dhpl.comuf.com/json.php it's working if you want to check.
Could anybody help me <table id="grid"> <thead> <tr> <th data-field="one">One</th> <th data-field="two">Two</th> <th data-field="three">Three</th> </tr> </thead> <tbody> <tr> <td>1</td><td>2</td><td>3</td> </tr> <tr> <td>1</td><td>2</td><td>3</td> </tr> </tbody> </table> <script> $(document).ready(function() { var element = $("#grid").kendoGrid({ height: 450, sortable: true, detailInit: detailInit }); }); function detailInit(e) { } </script>// KendoUI gridvar kgrid = $("#rate_grid").kendoGrid({ dataSource: { data: get_rates(), pageSize: 100 }, height: 360, groupable: false, scrollable: { virtual: true }, sortable: true, pageable: false, columns: [ { field: "rate_name", width: '65px', title: "Name" } , { field: "rate", title: "Rate" } , { field: "high_rate", title: "High" }], rowTemplate: kendo.template($("#rowTemplate").html()), dataBound: onDataBound});setInterval( function() { // if KendoUI grid instance, update it if (typeof kgrid !== "undefined") { $('#rates_load small').text(); var re_grid = $("#rate_grid").data("kendoGrid"); var new_grid_data = get_rates(); re_grid.dataSource.data(new_grid_data); re_grid.refresh(); }}, 5000);<div id="variantTabs"></div><div id="comboBox"></div><script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"></script><script src="kendoUI/js/kendo.all.js" type="text/javascript"></script><script type="text/javascript"> function Variant(_name,_id,_content){ this.text=_name; this.id=_id; this.content=_content; } function VariantsViewModel(){ var VariantsList=[ new Variant("first","1",""), new Variant("second","2",""), new Variant("third","3","") ]; var localDataSource = new kendo.data.DataSource({data: VariantsList}); $("#variantTabs").kendoTabStrip({ dataSource:localDataSource }); $("#comboBox").kendoComboBox({ index: 0, dataTextField: "text", dataValueField: "id", dataSource:localDataSource }); } $(function(){VariantsViewModel();}); </script>