【发布时间】:2015-09-01 08:20:09
【问题描述】:
我有这个代码Ext.get('book').setValue('1');
注意:加载页面,book value 设置为 1。页面加载后不加载 账面价值变为 1。
它将 book 的值设置为 1。但它不会触发 change 事件。有没有办法在页面加载后触发 change 事件?
编辑: 在 html 脚本中,
<script..>
$(document).ready(function () {
$("book").on("blur", function() {
//calls other function
}); // not called as blur is not invoked
});
</script>
<input id="book" type="book" value="" /><br />
在 extjs 中,
var panel = Ext.create('Ext.grid.Panel', {
id: 'panel',
columns: [
var bookid = "new book";
Ext.Ajax.request({
params: { bookid: bookid},
function: function (response) {
Ext.get('book').setValue(bookid);
// after setValue, book will receive a change event(e.g .blur in html) and changes other functions
}
});
]
});
【问题讨论】:
-
是的,在你的应用初始化中设置它
-
除了在app初始化中做,还有其他方法吗?因为它是在页面加载之后,然后在设置书籍文本字段值之前触发按钮@Icepickle
-
我认为您也可以设置一个默认值,但是您的代码示例/问题非常有限,很难看出您有什么问题。您能否提供更详细的说明(编辑您的起始帖子?)
标签: javascript html extjs sencha-architect