效果如图:
思路:
设置两个变量,存放input的Id和placeholder值,
根据id更新input的placeholder值。
inputId: '',
placeholder : '',
initComponent 函数最后添加
me.inputId = me.id+'-inputEl';
afterRender函数最后添加
if(this.placeholder){ document.getElementById(this.inputId).setAttribute('placeholder',this.placeholder);
}
使用方法
xtype: 'searchfield',
placeholder: '查找',
store: Store