Interface: IEditorArgumentsOpenPrintJobBuilder
Builder methods available after setPrintJob(guid, 'Edit'). Use them to change the loaded print job before it opens in the editor.
Remarks
The changes are applied by the editor when it loads the print job: variants and printings are added to (or removed from) the ones it already has. They don't change the open mode.
Example
window.tronDesigner
.setPrintJob(printJobGuid, 'Edit')
.removeProductVariantsFromPrintJob(['10601301', '10601331'])
.removePrintingFromPrintJob('back', 'GPE01')
.open({ mode: 'dialog' });See
Extended by
Methods
addPrintingsToPrintJob()
addPrintingsToPrintJob(...printings: ArgAddPrinting[]): IEditorArgumentsOpenPrintJobBuilder;Adds several printings to the existing print job. Printings the print job already has are ignored.
Parameters
| Parameter | Type | Description |
|---|---|---|
...printings | ArgAddPrinting[] | The printings, each with at least printPositionCode and printTechnologyCode (see ArgAddPrinting). |
Returns
IEditorArgumentsOpenPrintJobBuilder
addPrintingToPrintJob()
addPrintingToPrintJob(
printPositionCode: string,
printTechnologyCode: string,
positionCodeOverride?: string,
positionNameOverride?: string,
technologyCodeOverride?: string,
technologyNameOverride?: string,
options?: Partial<Pick<EditorOptions, "showSelectedPrintOptions" | "alwaysShowImageSelect">>,
maxColorsOverride?: number,
maxWidthOverride?: number,
maxHeightOverride?: number,
maxDiameterOverride?: number,
maxAreaOverride?: number
): IEditorArgumentsOpenPrintJobBuilder;Adds a printing to the existing print job. If the print job already has it, it is ignored.
Parameters
| Parameter | Type | Description |
|---|---|---|
printPositionCode | string | Print position code, e.g. 'back'. |
printTechnologyCode | string | Print technology code, e.g. 'GPE01'. |
positionCodeOverride? | string | Print position code to show instead of the catalog one. |
positionNameOverride? | string | Print position name to show instead of the catalog one. |
technologyCodeOverride? | string | Print technology code to show instead of the catalog one. |
technologyNameOverride? | string | Print technology name to show instead of the catalog one. |
options? | Partial<Pick<EditorOptions, "showSelectedPrintOptions" | "alwaysShowImageSelect">> | Printing-related editor options (see AddPrintingOptions). |
maxColorsOverride? | number | Maximum number of colors, instead of the catalog value. |
maxWidthOverride? | number | Maximum print width in mm, instead of the catalog value. |
maxHeightOverride? | number | Maximum print height in mm, instead of the catalog value. |
maxDiameterOverride? | number | Maximum print diameter in mm, instead of the catalog value. |
maxAreaOverride? | number | Maximum print area, instead of the catalog value. |
Returns
IEditorArgumentsOpenPrintJobBuilder
Example
window.tronDesigner
.setPrintJob(printJobGuid, 'Edit')
.addPrintingToPrintJob('back', 'GPE01')
.open({ mode: 'dialog' });addProductVariantsToPrintJob()
addProductVariantsToPrintJob(...variants: ArgAddProductVariant[]): IEditorArgumentsOpenPrintJobBuilder;Adds several product variants to the existing print job. Variants the print job already has get their quantity and display overrides updated.
Parameters
| Parameter | Type | Description |
|---|---|---|
...variants | ArgAddProductVariant[] | The variants, each with at least productCode (see ArgAddProductVariant). |
Returns
IEditorArgumentsOpenPrintJobBuilder
addProductVariantToPrintJob()
addProductVariantToPrintJob(
productCode: string,
quantity?: number,
codeOverride?: string,
nameOverride?: string
): IEditorArgumentsOpenPrintJobBuilder;Adds a product variant to the existing print job. If the print job already has the variant, its quantity and display overrides are updated.
Parameters
| Parameter | Type | Description |
|---|---|---|
productCode | string | Supplier code of the product variant. |
quantity? | number | Quantity of the variant. |
codeOverride? | string | Variant code to show instead of the catalog one. |
nameOverride? | string | Variant name to show instead of the catalog one. |
Returns
IEditorArgumentsOpenPrintJobBuilder
Example
window.tronDesigner
.setPrintJob(printJobGuid, 'Edit')
.addProductVariantToPrintJob('10601301', 50)
.open({ mode: 'dialog' });removePrintingFromPrintJob()
removePrintingFromPrintJob(printPositionCode: string, printTechnologyCode: string): IEditorArgumentsOpenPrintJobBuilder;Removes a printing from the existing print job.
Parameters
| Parameter | Type | Description |
|---|---|---|
printPositionCode | string | Print position code of the printing. |
printTechnologyCode | string | Print technology code of the printing. |
Returns
IEditorArgumentsOpenPrintJobBuilder
removePrintingsFromPrintJob()
removePrintingsFromPrintJob(removedPrintings: object[]): IEditorArgumentsOpenPrintJobBuilder;Removes several printings from the existing print job.
Parameters
| Parameter | Type | Description |
|---|---|---|
removedPrintings | object[] | The print position and technology code pairs of the printings to remove. |
Returns
IEditorArgumentsOpenPrintJobBuilder
removeProductVariantFromPrintJob()
removeProductVariantFromPrintJob(productCode: string): IEditorArgumentsOpenPrintJobBuilder;Removes a product variant from the existing print job.
Parameters
| Parameter | Type | Description |
|---|---|---|
productCode | string | Supplier code of the product variant. |
Returns
IEditorArgumentsOpenPrintJobBuilder
removeProductVariantsFromPrintJob()
removeProductVariantsFromPrintJob(productCodes: string[]): IEditorArgumentsOpenPrintJobBuilder;Removes several product variants from the existing print job.
Parameters
| Parameter | Type | Description |
|---|---|---|
productCodes | string[] | Supplier codes of the product variants. |
Returns
IEditorArgumentsOpenPrintJobBuilder
setDataMode()
setDataMode(dataMode: DataMode): this;Sets the data mode of the editor arguments: what the customer may change in the editor.
Parameters
| Parameter | Type | Description |
|---|---|---|
dataMode | DataMode | 'Exact', 'Partial' or 'Own' (see DataMode). |
Returns
this
Remarks
Mostly useful for Edit sessions: setPrintJob(guid, 'Edit') sets no data mode, so the editor runs them as Partial (the customer can add and remove printings). Call setDataMode('Exact') to lock the structure of the print job. In Create sessions the product methods set the data mode themselves (the last one wins); call setDataMode after them to override it.
Example
window.tronDesigner.setPrintJob(printJobGuid, 'Edit').setDataMode('Exact').open({ mode: 'dialog' });See
setEditorOptions()
setEditorOptions(options: Partial<EditorOptions>): this;Merges options into editorOptions of the editor arguments.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | Partial<EditorOptions> | Any subset of EditorOptions; the values you pass overwrite those set before. |
Returns
this
Remarks
The product and printing methods accept the options that belong to them (AddProductOptions, AddPrintingOptions) and call this method; use it for anything else, e.g. showSelectedVariants in Exact mode.
Example
window.tronDesigner
.setExactProduct('PFC', undefined, (b) => b.addVariant('10086021'))
.addExactPrinting('front', 'PAD03')
.setEditorOptions({ showSelectedVariants: 'All' })
.open({ mode: 'dialog' });Properties
| Property | Type | Description |
|---|---|---|
addCustomProperties | (customProperties: Record<string, string>) => IEditorArgumentsBuilder | Adds or updates several custom properties of the print job. See IEditorArgumentsBuilder.addCustomProperties. |
addCustomProperty | (key: string, value: string) => IEditorArgumentsBuilder | Adds or updates a custom property of the print job. See IEditorArgumentsBuilder.addCustomProperty. |
open | (options: DesignerOptions) => void | Opens the editor with the print job and the changes collected so far, and resets the builder. See IEditorArgumentsBuilder.open. |
setOrderInfo | (orderTitle?: string, orderCode?: string, orderItemCode?: string) => IEditorArgumentsBuilder | Sets the order information of the print job. See IEditorArgumentsBuilder.setOrderInfo. |
setPrintJobCustomer | (customerIdentity?: string, customerPerson?: string, customerCompany?: string, customerEmail?: string) => IEditorArgumentsBuilder | Sets the customer details stored with the print job. See IEditorArgumentsBuilder.setPrintJobCustomer. |
setPrintJobTitle | (title: undefined | string) => IEditorArgumentsBuilder | Sets the title of the print job. See IEditorArgumentsBuilder.setPrintJobTitle. |