1、Ext.form.Label主要配置
配置項 | 類型 | 說明 |
---|---|---|
forId | String | 與標簽字段進行關聯的目標組件的inputId |
html | String | 顯示在標簽字段innerHTML的HTML片段,如果同時指定了text配置則html優先 |
text | String | 顯示在標簽中的文本 |
2、Ext.form.Label示例
代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Ext.form.field.Label示例</title> <link href="ext-4.0.7-gpl/resources/css/ext-all.css" rel="stylesheet" type="text/css" /> <script src="ext-4.0.7-gpl/bootstrap.js" type="text/javascript"></script> <script type="text/javascript"> Ext.onReady(function () { Ext.create("Ext.form.Panel", { title: "Ext.form.field.Label示例", width: 200, frame: true, renderTo: Ext.getBody(), bodyPadding: 5, items: [{ xtype: "label", forId: "UserName", text: "用戶名" }, { name: "UserName", xtype: "textfield", inputId: "UserName", hideLabel: true }] }); }); </script> </head> <body> </body> </html>
效果圖: