1
中的特定事件沒關係,所以我正在開發一個商店插件,我需要將disabled
輸入字段更改爲已在XTemplate中定義的readonly
字段。ExtJS XTemplate替換字符串
我一直在試圖找到一種方法來使這項工作,但我不能拿出任何東西。
此代碼是一個精簡版,有多個輸入字段,其中一些也被禁用,但這是最後一次發生。 任何提示表示讚賞! :)
/**
* Some function...
*/
createSomeFunction: function() {
var me = this;
return new Ext.XTemplate(
'<tpl for=".">',
//stripped this down
'<p>',
'<strong>'+me.snippets.mediaInfo.adress+'</strong>',
'<input type="text" disabled="disabled" value="{path}" />',
'</p>',
'</div>',
'</div>',
'</tpl>',
{
//formatting functions
someFormattingFunctions: function(value) {
//...
}
}
)
}
https://developer.mozilla.org/en/docs/Web/HTML/Element/input 看到關於readOnly的一點。 –
我想用readonly =「readonly」替換disabled =「disabled」。 這段代碼來自商店,所以我不能直接編輯它,我需要覆蓋它,但只替換這個位而不是整個模板。 –