extjs的cls属性怎么使?

extjs的cls属性怎么使?,第1张

你可以用浏览器的开发人员工具查看ExtJS生成的html代码,这样你就会发现,你在cls中配置字符串,被添加到了对应html元素的class中。所以,使用cls,你要自定义一个类选择器的css,然后再cls中写类名。看下面的例子。

<body>

<style type="text/css">

    .myCls{

        color: red

    }

</style>

<script type="text/javascript">

    Ext.create('Ext.panel.Panel',{

        items:[

            {

                xtype:'label',

                text:'这里的文字是红色',

                cls:'myCls'

            }

        ],

        renderTo:Ext.getBody()

    })

</script>

</body>

Ext.create('Ext.tree.Panel',{ title:'Simple Tree', root:{ text:"Root node", expanded:true,//此处展开所有。 children:[{ text:"Child 1", leaf:true},{ text:"Child 2", leaf:true}]}, renderTo:Ext.getBody()})有个配置项root root的ex

如下,查看API即可。。。

trackResetOnLoad : Boolean

If set to true, reset() resets to the last loaded or setValues() data instead of when the form was first created.

Defaults to: false

isDirty( )

Returns true if any fields in this form have changed from their original values.

Note that if this BasicForm was configured with trackResetOnLoad then the Fields' original values are updated when the values are loaded by setValues orloadRecord.

可知、trackResetOnLoad 设置为true后,就会重新捞数据、这正好符合isDirty的条件。。。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11410337.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存