文檔金喜正規買球>>Kendo UI使用教程-2019>>Kendo UI for jQuery數據管理使用教程:行模板
Kendo UI for jQuery數據管理使用教程:行模板
Kendo UI for jQuery R2 2020 SP1試用版下載
Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個控件。Kendo UI for jQuery是創建現代Web應用程序的最完整UI庫。
行模板
Kendo UI Grid支持行模板,使您可以將自定義內容放入Grid行。
有關可運行的示例,請參閱:
如果從div元素初始化Grid,則可以通過使用腳本標簽中的模板或列對象上的template選項中的模板來格式化Grid中的任何單元格。
下面的示例演示如何使用模板通過腳本塊中聲明的模板將電子郵件地址格式化為超鏈接。
<script id="template" type="text/x-kendo-tmpl"> <tr> <td> #= firstName # </td> <td> #= lastName # </td> <td> <a href="mailto:#= email #">#= email #</a> </td> </tr> </script>
下面的示例演示如何通過將其傳遞到rowTemplate選項并使用kendo.template函數對其進行初始化,來將前一種方法指定為每行的模板。 結果,電子郵件地址是一個交互式超鏈接,當用戶單擊它時,它將打開一個新的電子郵件。
$("#grid").kendoGrid({ rowTemplate: kendo.template($("#template").html()), // Other configuration. });
如圖:具有已應用行模板的網格
