Ext中是怎样识别Displaying {0} - {1} of {2}?
{0}{1}{2}as tokens that are replaced by the values for start, end and total。它是怎样识别的?
看一下它的实现代码你就知道啦,如下:
[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]