Ext.form.Label标签字段

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>

效果图:

posted @ 2012-04-22 21:41  libingql  阅读(25263)  评论(0编辑  收藏  举报