简体   繁体   English

对象函数没有方法延迟

[英]Object function has no method defer

I'm try to render a progress bar in grid (Ext JS), and get this error: 我试图在网格中渲染进度条(Ext JS),并得到此错误:

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. 函数defer用于将函数调用延迟X毫秒。 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 . 这应该根据ExtJS API文档工作

Which version of ExtJS are you using? 您使用的是哪个版本的ExtJS?

Are you sure you have all the ExtJS loaded? 你确定你加载了所有的ExtJS吗? 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. Ext.defer或Ext.function.defer是一个类似于javascript setTimeout函数的函数。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM