Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個(gè)控件。Kendo UI for jQuery是創(chuàng)建現(xiàn)代Web應(yīng)用程序的完整UI庫。
某些Kendo UI窗口小部件提供了編輯功能,該功能通過使用Kendo UI MVVM綁定使用特定的編輯器元素或與模型綁定的表單來實(shí)現(xiàn)。

以下小部件支持編輯功能:
入門指南
支持編輯的Kendo UI小部件提供以下常用配置選項(xiàng):
注意:一些小部件提供了其他可編輯選項(xiàng),有關(guān)更多詳細(xì)信息,請參閱特定的窗口小部件API文檔。 例如Grid小部件可以使用editable.destroy選項(xiàng)禁用刪除功能。
支持編輯的Kendo UI小部件提供以下常見事件:
注意:
要啟用小部件的編輯功能:
這些方法主要適用于支持編輯的其他Kendo UI小部件。
使用編輯器表單
您可以構(gòu)建編輯器表單并將特定模型綁定到編輯器表單。
構(gòu)建編輯器表單
Kendo UI窗口小部件基于schema.model結(jié)構(gòu)(更具體地說是字段集合)動(dòng)態(tài)構(gòu)建編輯器表單。
注意:
|
數(shù)據(jù)類型 |
編輯 |
PARSER |
|
string |
Internal method. String conversion. |
|
|
number |
kendo.ui.NumericTextBox |
kendo.parseFloat() |
|
date |
kendo.ui.DatePicker |
kendo.parseDate() |
|
boolean |
Internal method. Boolean conversion. |
|
|
object |
Not processed. The value is passed as is. |
下表列出了可用的數(shù)據(jù)類型。
下面的示例演示如何通過DataSource schema.model聲明字段定義。
schema: {
model: {
id: "id",
fields: {
id: {
editable: false,
// A defaultValue will not be assigned (default value is false).
nullable: true
},
name: {
type: "string",
validation: { required: true }
},
price: {
// A NumericTextBox editor will be initialized in edit mode.
type: "number",
// When a new model is created, this default will be used.
defaultValue: 42
},
discontinued:{
// A checkbox editor will be initialized in edit mode.
type: "boolean"
},
created: {
// A date picker editor will be initialized in edit mode.
type: "date"
},
supplier: {
type: "object" ,
defaultValue: { companyName: "Progress", companyId: 1 }
}
}
}
}
注意:Kendo UI Scheduler具有靜態(tài)模型結(jié)構(gòu),并且僅遵循預(yù)定義的模型字段列表。 要編輯其他字段,請使用自定義編輯器模板。
自動(dòng)生成的編輯器表單通過Kendo UI MVVM模式綁定到模型,該小部件還允許您使用自定義編輯器模板覆蓋此表單。
創(chuàng)建表單后,小部件將執(zhí)行以下操作:
注意:編輯器表單是在觸發(fā)編輯事件之前創(chuàng)建并綁定的,并且已經(jīng)被填充。
將特定模型綁定到編輯器表單
觸發(fā)edit事件后,小部件將獲取相應(yīng)的模型,并通過Kendo UI MVVM模式將生成的或自定義編輯器表單綁定到該模型。 通過使用值綁定來完成模型字段和表單編輯器之間的連接。
此連接遵守以下規(guī)則:
京ICP備09015132號(hào)-996 | 違法和不良信息舉報(bào)電話:4006561155
© Copyright 2000-2026 北京哲想軟件有限公司版權(quán)所有 | 地址:北京市海淀區(qū)西三環(huán)北路50號(hào)豪柏大廈C2座11層1105室
北京哲想軟件集團(tuán)旗下網(wǎng)站:哲想軟件 | 哲想動(dòng)畫