最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Object function has no method defer - Stack Overflow

programmeradmin3浏览0评论

I'm try to render a progress bar in grid (Ext JS), and get this error:

Object function has no method defer

What is this "magical" method? What does it do? And why is it not found? Code:

renderer: function (value, meta, rec, row, col, store){
    var id = Ext.id();
    (function(){
        new Ext.ProgressBar({
            renderTo: id,
            value: 0.5
        });
    }).defer(25);
    return '<span id="' + id + '"></span>';
}

I'm try to render a progress bar in grid (Ext JS), and get this error:

Object function has no method defer

What is this "magical" method? What does it do? And why is it not found? Code:

renderer: function (value, meta, rec, row, col, store){
    var id = Ext.id();
    (function(){
        new Ext.ProgressBar({
            renderTo: id,
            value: 0.5
        });
    }).defer(25);
    return '<span id="' + id + '"></span>';
}
Share Improve this question edited Apr 17, 2011 at 9:52 Tommi 8,6085 gold badges33 silver badges51 bronze badges asked Apr 16, 2011 at 19:17 KeinKein 9962 gold badges14 silver badges33 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 10

The function defer is used to delay a function call by X milliseconds. Try a syntax like this:

Ext.Function.defer(function(){
    new Ext.ProgressBar({
        renderTo: id,
        value: 0.5
    });
}, 25);

That should work according to ExtJS API documentation.

Which version of ExtJS are you using?

Are you sure you have all the ExtJS loaded? Do you get the same error when you run this code from browser mand line:

(function(){alert("Hello");}).defer(1000);

Ext.defer or Ext.function.defer is a function similar to javascript setTimeout function.

http://astutejs.blogspot.in/2015/06/extjs-what-is-extdefer.html

发布评论

评论列表(0)

  1. 暂无评论