dennysutanto
10/10/2024, 5:44 PMCeligo AI
10/10/2024, 5:45 PMAI generated answer (using internal Slack threads):In order to overcome the issue of data selection being cleared when navigating between pages in a Suitelet with a standard sublist and pagination, you can use a hidden field to store the selected values. This way, you won't lose any data when moving between pages. Here is a sample code snippet that was shared in the conversation:
javascript
    //listens fieldChanged
    function handlePageChange(rec, context) {
        var currPage = Number(rec.getValue(context.fieldId));
        var multiplier =100;
        var minRow = (currPage - 1) * multiplier;
        var maxRow = (currPage * multiplier) - 1;
        var lineCount = rec.getLineCount('custpage_sublistid');
        for (var i = 0; i < lineCount; i++) {
            (i >= minRow && i <= maxRow)
                ? updateRowDisplay(i, '')
                : updateRowDisplay(i, 'none');
        }
    }
    //listens handlePageChange
    function updateRowDisplay(line, displayType) {
        jQuery('#custpage_sublistidrow' + line).css('display', displayType);
    }serverWidgetSublistType.STATICLISTCeligo AI
10/10/2024, 5:46 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845114589
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843838215
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821773291
Celigo AI
10/10/2024, 5:46 PM