Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object function has no method defer

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>';
}
like image 679
Kein Avatar asked Apr 16 '11 19:04

Kein


2 Answers

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.

like image 122
Tommi Avatar answered Oct 14 '22 03:10

Tommi


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 command line:

(function(){alert("Hello");}).defer(1000);
like image 2
Rene Saarsoo Avatar answered Oct 14 '22 03:10

Rene Saarsoo