mxCell 的 id 默认使用整数类型,每次递增 1,但我们希望将其替换为 UUID 类型。覆盖默认功能的更好方法是什么?谢谢
mxGraphModel.prototype.createId = function(cell)
{
var id = this.nextId;
this.nextId++;
return this.prefix + id + this.postfix;
};
上面的方法我已经改了,但是不确定是否会影响mxGraph中的其他模块。
mxGraphModel.prototype.createId = function(cell)
{
var id = myUtils.getUUID() //a method to return an UUID
return this.prefix + id + this.postfix;
};