I could not find it in the API documentation or any explanation on different Internet search engine query results.
It's the function that ExtJS uses internally to generate unique IDs for DOM elements that are created by ExtJS. From my console at http://www.sencha.com:
> Ext.id
function (e,D){return(e=Ext.getDom(e)||{}).id=e.id||(D||"ext-gen")+(++h)}
> Ext.id()
"ext-gen22"
> Ext.id()
"ext-gen23"
> Ext.id()
"ext-gen24"
See here (scroll down to Public Methods -> id
) and here.
/**
* Generates unique ids. If the element already has an id, it is unchanged
* @param {Mixed} el (optional) The element to generate an id for
* @param {String} prefix (optional) Id prefix (defaults "ext-gen")
* @return {String} The generated Id.
*/
id : function(el, prefix){
el = Ext.getDom(el, true) || {};
if (!el.id) {
el.id = (prefix || "ext-gen") + (++idSeed);
}
return el.id;
},
One helpful thing that I've done in the past if you need to generate a unique ID for whatever reason, is just to do something like:
var id = Ext.id();
id = parseInt(id.replace("ext-gen", ""));
return id;
That'll get rid of the "ext-gen" part of the String that Ext.id() returns and give you an int (if you need it).
For unique ID number you can also just do:
var uniqueId = ++Ext.idSeed;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With