在使用ExtJS开发时,有些样式不好写,需要用tpl自己手绘html样式。
但是这些绘制的html,又想要点击可以用extjs控件进行编辑,如下图
这个是用DataView一类,含有tpl(或itemtpl)一类控件绘制的
在进行替换时,主要通过
htmlDom对象.replaceWith(extjs控件.el);
或采用
htmlDom对象.doReplaceWith(extjs控件.element);
For Ex
{
xtype: 'dataview',
fullscreen: true,
itemsFocusable:false,//重要! 让dataview里的控件可聚焦
itemTpl: [
'<div class="exttext" >点击变成{text}控件</div>',
'<div class="time">点击变成时间控件{time}</div>'
],
store: [
{
text: 'extjs',