Comments (7)
我觉得需要确保。看起来用户貌似没有显式修改的需求,但是可能会这样
var myButton = new Button();
xxCtrl.addChild( myButton );
如果xxCtrl不是在默认viewContext下,myButton的viewContext是需要被更改的。
from esui.
那么我建议把data-ctrl-id
和data-ctrl-view-context
的配置丢到Control
上去实现,而不在main
中搞这事,只要是控件,其主元素就一定有这2个东西
from esui.
补充一下,如果放在Control
上实现,我们需要考虑是否允许setProperties({ viewContext: xxx })
这样的写法,如果允许的话,我们还得把viewContext
的修改放在repaint
上实现,当然实现就一两行代码,不过所有的控件要记得调Control.prototype.repaint
哦
from esui.
那么我建议把data-ctrl-id和data-ctrl-view-context的配置丢到Control上去实现,而不在main中搞这事,只要是控件,其主元素就一定有这2个东西
配置放main上是为了统一配置项的存放地,万一esui默认使用的data-xxxxxxx与用户已经用了的有冲突,可以在一个地方统一配置
from esui.
我们需要考虑是否允许setProperties({ viewContext: xxx })这样的写法
我没想到什么场景需要这样用,但是,从一致性上来讲,貌似需要支持
from esui.
那么我去开工啦- -
from esui.
在 53637ca 中支持, @errorrik 做下review没问题关吧?
from esui.
Related Issues (20)
- 日程投放控件 HOT 4
- InputCollection 应当继承 ControlCollection HOT 1
- Table 的 overflowX 属性为非 hidden 的时候多出一个横向滚动条 HOT 3
- BoxGroup有一处事件没使用addDOMEvent绑定
- 解决set和setProperties触发change的问题
- Table的依赖不全
- 控件初始化子控件时的valueReplacer管理
- 控件初始化子控件时的valueReplacer管理
- 控件初始化子控件时的valueReplacer管理
- 指定元素的销毁子控件
- Select 控件对于value比较判断的兼容性问题 HOT 2
- 希望能添加一些布局相关的组件 HOT 4
- 对于带有数据源的控件是否应该支持外部不提供数据源的场景的表决 HOT 19
- addChild的时候添加校验 HOT 6
- viewContext的疑问 HOT 3
- 加个Lisence HOT 1
- MonthView的年月下拉框格式可调 HOT 1
- 渐变背景的问题
- Panel控件的addContent方法不适用table布局 HOT 2
- 关于拓展组件
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esui.