class TuningOptions{ constructor(){ this.name = "tuningoptions"; } static GetColumns(){ return ["name","price","id"] } static allowAddNew(){ return userrights.has("parts_acceptance.edit") } static allowEdit(){ return userrights.has("parts_acceptance.edit") } static allowDelete(){ return userrights.has("parts_acceptance.delete") } static TableDataCreate(row, key){ if(key == "id"){ return ` ${Form.getEditButtonIcon(row[key] , this.name + ".edit", this.allowEdit())} ${Form.getDeleteButtonIcon(row[key], this.name, this.allowDelete())} `; } else if(key == "price"){ return ` ${System.FormatNumber(row[key])} `; } else{ return `${row[key]}`; } } static GetEdit(data={}){ return { "name": { "val" : data.name ?? "" ,"type" : "text" ,"isRow": true ,"mandatory":true }, "price": { "val" : data.price ?? "" ,"type" : "number" ,"isRow": true ,"mandatory":true } } } }