Ext中是怎样识别Displaying {0} - {1} of {2}?
{0}{1}{2}as tokens that are replaced by the values for start, end and total。它是怎样识别的?
Ext中怎样识别Displaying {0} - {1} of {2}?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
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]本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报