kendo分多個版本,核心UI免費版.NET,JAVA,PHP對應的先後端開發版。html
基礎免費版開放的UI經多個測試,與收費封裝的UI並沒有區別,收費版提供了後端代碼和前端封裝語法,使不懂JS前端的也可簡易開發。前端
基礎免費版與專業版的DEMO差距實在太大,基礎版的DEMO只提供最基礎的DEMO樣例,好比listView的服務器端翻頁,官網上的樣例無一個涉及,統統都是前一次加載徹底部數據前端翻頁。ajax
實際開發的話,後端的開發人員,不肯購買其各語言封裝專業版,或想寫純JS,再或者須要深度定製拓展的,能夠在收費的DEMO中獲得應有的API信息。後端
從開發版的DEMO中看出前端生成的JS代碼數據樣例,再看後端提交,處理,返回的數據。即可以純JS的方式操做和自定義拓展功能。服務器
實際工做並不複雜mvc
如下是我的工做中以這種思路實現的部分功能展現和代碼。測試
KenDo UI ListView實現的聊天記錄統計展現功能(還未做完)url
<script> function getdatestring(dt) { var s = dt.indexOf('('); var e = dt.indexOf(')'); var strdate = dt.substring(s + 1, e); //return strdate; return new Number(strdate); } //1000 建立未接入會話 //1001 接入會話 //1002 主動發起會話 //1004 關閉會話 //1005 搶接會話 //2001 公衆號收到消息 //2002 客服發送消息 //2003 客服收到消息 function isUserSendInfo(ope) { if (ope == 2003 || ope == 2001) { return "in"; } if (ope == 2002) return "out"; return ""; } function gethidden1(ope) { if (ope == 2003 || ope == 2001) return "none"; else return ""; } //當是客服發信息時 function gethidden2(ope) { if (ope == 2002) return "none"; else return ""; } </script> <script type="text/x-kendo-template" id="template2"> <li class="#:isUserSendInfo(opercode)#"> <div class="message"> <span class="arrow"></span> <a class="name" style="display: #:gethidden2(opercode)#; ">#:nickname#</a> <span class="datetime">#:kendo.toString(new Date(getdatestring(date)),"yyyy-MM-dd")# #:kendo.toString(new Date(time),"HH:mm")#</span> <a class="name" style="display:#:gethidden1(opercode)#; ">#:worker#</a> <span class="body">#:text#</span> </div> </li> </script> <div class="demo-section"> <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 600px;"> <div id="listView" class="scroller" data-height="600px" data-always-visible="1" data-rail-visible1="1" style="overflow: hidden; width: auto; height: 600px;"> <ul class="chats" id="ullist"> </ul> </div> </div> <div id="pager" class="k-pager-wrap"></div> </div> <script> $(function() { var dataSource = new kendo.data.DataSource({ "transport": { "prefix": "", "read": { "url": "/Admin/MpCustomerService/MpCustomerServiceConfig_Read_List?mpaccountid=112" } }, "pageSize": 10, "page": 1, "total": 0, "serverPaging": true, //"serverSorting": true, //"serverFiltering": true, //"serverGrouping": true, //"serverAggregates": true, "type": "aspnetmvc-ajax", "filter": [], "schema": { "data": "Data", "total": "Total", "errors": "Errors", } }); $("#pager").kendoPager({ dataSource: dataSource }); $("#ullist").kendoListView({ dataSource: dataSource, template: kendo.template($("#template2").html()) }); }); </script>
從收費版支持較好的先後端DEMO中獲知API信息,再用於免費版的應用開發。spa