Hybrid View
-
12 Apr 2012 1:04 PM #1
valid id
valid id
Below is the code from extjs 4.1 RC3 api.
Looking at validIdRe, you guys are disallowing id start with number. Is there any reason for this?
{
xtype:"panel",
id:"099890-333"
}
Code:escapeId: (function() { var validIdRe = /^[a-zA-Z_][a-zA-Z0-9_\-]*$/i, escapeRx = /([\W]{1})/g, escapeFn = function(match, capture){ return "\\" + capture; }; return function(id) { return validIdRe.test(id) ? id : id.replace(escapeRx, escapeFn); }; }())
-
12 Apr 2012 1:20 PM #2
We are just following the rules

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")
Regards,
Scott.
-
12 Apr 2012 1:22 PM #3


Reply With Quote
