My Code:
ds.on('load', foo, this, {delay: 250});
Bug:
h has no properties
(ext-all.js : line 18) - Ext.util.Observable
ds.on('load', foo, this, {delay: 250});
Bug:
h has no properties
(ext-all.js : line 18) - Ext.util.Observable
|
#
2
|
|
Are you sure foo exists? That message means your handler function is undefined.
I just tested it locally and it worked as expected. When I passed in an undefined handler function, I got the same message as you.
|
|
#
3
|
|
ok i get it..
I tried doing this and didnt work: ds.on('load', plantGrid.getView().autoSizeColumns(), this, {delay: 250}); the reason why i was trying to do it this way was because when you put autoSizeColumns in the the configuration of the grid.. it loads to fast and doesn't size properly. it works now without the delay by doing this: ds.on('load', adjustGrid, this, {delay: 250}); function adjustGrid(){ plantGrid.getView().autoSizeColumns(); }
|
|
#
4
|
|
The problem is you are executing the function immediately (you have "()" at the end) rather than passing a callback. Also, your scope with be wrong. Here's your original code edited:
var view = plantGrid.getView(); ds.on('load', view.autoSizeColumns, view, {delay: 250}); Here we are passing a function (rather than calling the function) and we are setting the scope to the "view" object so that within autoSizeColumn the this reference with be correct.
|
|
#
5
|
|
NICE!!!..
I never looked at it way. It works perfectly. THANKS!! Will be tipping you soon.
|
ExtJS Grid 自动调整列宽
本文讨论了使用ExtJS框架中Grid组件的自动调整列宽功能时遇到的问题及解决办法。具体介绍了如何正确地将自定义函数作为加载事件的回调,并确保作用域设置正确。

1万+

被折叠的 条评论
为什么被折叠?



