<SCRIPT> var sharabledatasource = new Kendo. data. datasource ({transport: {read: {URL: "data-service.json", datatype: "JSON" }}, Schema: {data: function (d) {return D. data; // response to the page data}, total: function (d) {return D. count; // Total number of items }}); var datasource = new Kendo. data. datasource ({transport: {read: {URL: "http://t.sogx.cn/api/data/getQzxx.php", datatype: "jsonp", data: {q: "HTML5" }}, SC Hema: {data: function (d) {return D. data; // response to the page data}, total: function (d) {return D. count; // total number of entries }}); var viewmodel = Kendo. observable ({products = datasource;}); Kendo. BIND ($ ("Div"), viewmodel ); </SCRIPT> ============================== binding jquery to Kendo to remotely obtain data ========== =================$ (document ). ready (function () {$. ajax ({type: 'get', async: false, URL: "http://t.sogx.cn/wap/index.php? M = user & C = show & id = 2 ", data:" ajax = 1 ", datatype:" jsonp ", success: function (OBJ) {var viewmode5222 = Kendo. observable ({data2: obj. data}); Kendo. BIND ($ ("# drawer-resume"), viewmode5222 );}})}); ====================================<? Phpheader ('content-type: text/html; charset = gb2312 '); header ("access-control-allow-origin :*"); header ("access-control-allow-headers: X-requested-with"); Include ("D:/www.qmlt.com/global.php"); require (model_path. 'class/Common. PHP '); $ db-> query ("set Character Set 'gb2312'"); $ db-> query ("set names 'gb2312 '"); $ q = $ _ Get ['q']; if ($ q = "") {$ SQL = "select ID, name from qm_industry ";} else {$ SQL = "select ID, name from qm_jo B _class where keyid = '$ Q' ";}$ Ku = $ db-> query ($ SQL); $ result = array (); $ I = 0; while ($ rs = $ db-> fetch_array ($ ku) {$ result ['data'] [$ I] ['id'] = $ Rs [ID]; $ result ['data'] [$ I] ['name'] = (TRIM (U ($ Rs [name])! = "")? U ($ Rs [name]): "(untitled)"; $ I ++;} $ result ['Count'] = $ I; echo $ _ Get ['callback']. "(". json_encode ($ result ). ")";?>
When binding 1. kendoui template data #, you must find the data source format (one-dimensional or multi-dimensional. If the preceding conditions are not met, the binding fails, and a blank error is displayed.