TronDesigner – Integration Examples
Docs: Developer documentation  |  Result actions

Back to examples

Result Actions

The result action decides what the editor does after the customer confirms the final verification and the print job has been saved. Design something, click Continue, approve the printing and click Final Confirm:

The values are case-sensitive - 'CLOSE' or 'none' are treated as 'None'. The close reason passed to onClose is logged below.

Oregon 400 ml - Red

Result – None

Oregon 400 ml - Red

Result – Close

Oregon 400 ml - Red

Result – Dialog

onClose log


Implementation Code

JSON - editor.result

window.tronDesigner.openDesigner({
    openMode: 'Create',
    dataMode: 'Exact',
    printJob: {
        addProducts: { supplierCode: 'PFC', variants: [{ productCode: '10086021' }] },
        addPrintings: [{ printPositionCode: 'front', printTechnologyCode: 'PAD03' }]
    },
    editor: {
        result: {
            resultAction: 'Dialog',          // 'None' | 'Close' | 'Dialog' (case-sensitive)
            redirectUrl: '/cart',            // optional, for 'Close' and 'Dialog'
            closeDialog: [
                { language: 'en', title: 'Print Graphics ready', message: 'Your design has been saved.', buttonText: 'Continue to cart' }
            ]
        }
    }
}, {
    mode: 'dialog',
    onClose: (reason, redirectUrl) => console.log('Editor closed:', reason, redirectUrl)
});

JS builder

window.tronDesigner
    .setExactProduct('PFC', undefined, (b) => b.addVariant('10086021'))
    .addExactPrinting('front', 'PAD03')
    .setResultActionCloseEditor()               // or setResultActionNone() / setResultActionShowDialog(dialogs, redirectUrl)
    .open({ mode: 'dialog' });

HTML data attributes

<button data-td-action="OpenCreate"
        data-td-supplier-code="PFC"
        data-td-product-code="10086021"
        data-td-print-position-code="front"
        data-td-print-technology-code="PAD03"
        data-td-result-action="Close"
        data-td-result-redirect-url="/cart">
    Design your print
</button>