Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions modules/SS2/Record.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ module.exports = class Record {
} else {
this[fieldId].value = value;
}

return this;
}

setText(options){
Expand All @@ -91,6 +93,8 @@ module.exports = class Record {
} else {
this[fieldId].value = value;
}

return this;
}

getText(options){
Expand Down Expand Up @@ -134,12 +138,16 @@ module.exports = class Record {
} else {
this.currentLines[sublistId] = (this.sublists[sublistId].push({})) - 1
}

return this;
}

selectLine(options){
const sublistId = options.sublistId;
const line = options.line;
this.currentLines[sublistId] = line;

return this;
}

setCurrentSublistValue(options){
Expand All @@ -153,6 +161,8 @@ module.exports = class Record {

const line = this.currentLines[sublistId];
this.sublists[sublistId][line][fieldId] = value

return this;
}

insertLine(options){
Expand All @@ -168,6 +178,8 @@ module.exports = class Record {
}

this.sublists[sublistId].splice( line, 0, {})

return this;
}

setSublistValue(options){
Expand All @@ -177,6 +189,8 @@ module.exports = class Record {
const line = options.line;

this.sublists[sublistId][line][fieldId] = value

return this;
}

setSublistText(options){
Expand All @@ -186,12 +200,15 @@ module.exports = class Record {
const line = options.line;

this.sublists[sublistId][line][fieldId] = text

return this;
}

getSublistValue(options){
const sublistId = options.sublistId;
const index = options.line;
const field = options.fieldId;

return this.sublists[sublistId] ? this.sublists[sublistId][index][field] : undefined
}

Expand All @@ -216,6 +233,8 @@ module.exports = class Record {
if(!exists) {
this.nRecord.addRecord(this);
}

return this.id;
}

hasSublistSubrecord(options){
Expand Down