cosmocode / edittable

Plugin to provide a custom editor for tables in DokuWiki
https://www.dokuwiki.org/plugin:edittable
32 stars 26 forks source link

Feature Request: Keep header line on top when editing #200

Open pjotre42 opened 3 years ago

pjotre42 commented 3 years ago

I have the following feature request:

As a user, I would like to edit rather long tables (i.e. many rows), with keeping an eye on the column titles, so I know which information to put in which column

Current situation: When scrolling down, the header row disappears. A mitigation is possible by adding a new row at the top, and then (After filling the information) dragging it down to the intended position. But this is cumbersome, especially on mobile devices.

Request: I would like to have the header row always displayed, even when scrolling down (either static setting, or as an option to be turned on when entering edit-mode)

Thanks!

shankar2k commented 2 years ago

There doesn't appear to be a user-configurable option for freezing the header row, but I was able to achieve this effect by editing the source code.

In lib/plugins/edittable/script/editor.js near line 142 there is the code for configuring the handsontable:

        var handsontable_config = {
            data: data,
            startRows: 5,
            startCols: 5,
            colHeaders: true,
            rowHeaders: true,
            manualColumnResize: true,
            manualRowResize: true,
            outsideClickDeselects: false,
            contextMenu: edittable.getEditTableContextMenu(getData, getMeta),
            manualColumnMove: true,
            manualRowMove: true,
            mergeCells: merges,

You can freeze the header row by adding to the configuration list fixedRowsTop: 1,, and similarly you can freeze the first column by adding fixedColumnsLeft: 1,. Then you have to refresh the plugin, by performing the touch command on conf/local.php.

LeDistordu commented 1 year ago

+1 :)