English 中文(简体)
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> ;
}
最佳回答

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





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签