仲涵 2009-12-15 13:29
浏览 254
已采纳

Ext中怎样识别Displaying {0} - {1} of {2}?

Ext中是怎样识别Displaying {0} - {1} of {2}?
{0}{1}{2}as tokens that are replaced by the values for start, end and total。它是怎样识别的?

  • 写回答

1条回答 默认 最新

  • chanball 2009-12-15 13:38
    关注

    看一下它的实现代码你就知道啦,如下:
    [code="js"]
    format : function(format){
    var args = Array.prototype.slice.call(arguments, 1);
    return format.replace(/{(\d+)}/g, function(m, i){
    return args[i];
    });
    }
    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?