Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 669: Line 669:
             });
             });


             // Fix bug where the table is truncated to zero height despite having visible rows
             // Fix bug where the table is truncated to zero height despite having visible rows.
             tabulator.on('renderComplete', function() {
             tabulator.on('renderComplete', function() {
                 console.log('render complete')
                // TODO: Check the bugfix for a possible infinite event loop.
                // This will help detect it, in case it happens.
                 console.log('Table height bugfix: render complete.');
               
                 try {
                 try {
                     const holderHeight = tabulator.rowManager.element.offsetHeight;
                     const holderHeight = tabulator.rowManager.element.offsetHeight;
                     const tableHeight = tabulator.rowManager.tableElement.offsetHeight;
                     const tableHeight = tabulator.rowManager.tableElement.offsetHeight;
                     if (holderHeight < tableHeight) { tabulator.redraw(); }
                     if (
                        holderHeight < tableHeight ||                          // table is truncated vertically (including zero-height)
                        holderHeight - tableHeight > window.screen.availHeight  // table is more than a screen longer than content
                    ) {
                        tabulator.redraw();
                    }
                 } catch (ignore) { }
                 } catch (ignore) { }
                // tabulator.rowManager.displayRowsCount
             });
             });
            // End bugfix
         });
         });



Revision as of 14:43, 2 November 2022

Development verstion of the DCT List.
Not ready for production!