handsontable icon indicating copy to clipboard operation
handsontable copied to clipboard

readOnly `date` cells still show AutocompleteArrow

Open Nagle opened this issue 10 years ago • 3 comments

Nagle avatar Aug 08 '16 19:08 Nagle

Thanks for the proper labeling. May I add that

editor:false

also does nothing.

I could see how showing the date on a calendar.. irregardless of readOnly/editor state could be useful. That may not be a feature to disregard.. I dunno.

Perhaps an autocomplete icon variable? With hooks to set, show, hide, etc..

Anyhoo, here's how I've hacked around this:

function afterLoadDataHandler()
{
    console.info('HandsOnTable data has been (re-)loaded')
    hot3.updateSettings({
        cells: function (row, col, prop)
        {
            var cellProperties = {}
            if( 'locked' === hot3.getDataAtRowProp(row, 'status') )
            {
                if( 'SOMEDATEFIELD' === prop )
                {
                    cellProperties.type = 'text'
                }
            }
            return cellProperties;
        }
    })
}

TL;DR:

After data has been loaded, update the cell properties. I realize that this is an expensive operation 👎; however, I am working with isolated sets of data and do not have too much in a table.

If the status of the row is locked, and the cell's property is some date field.. {Potential refactor opportunity... if cell properties is date, then...} then change the cell's type to text.

Nagle avatar Aug 10 '16 02:08 Nagle

sure you can @Nagle!

You're right this trigger is useless when the cell is the readOnly mode.

Currently as a workaround rather than the solution we can use the CSS to overwrite the styling of this element, like here: http://jsfiddle.net/AMBudnik/eneLLx7y/ Your ideas are also great and I guess that there could be another workaround but to be honest we'll never know if any potential workaround can influence a code when we're updating to newer release.

AMBudnik avatar Aug 10 '16 09:08 AMBudnik

I am moving this conversation to Github Discussions and welcome everyone to discuss an expected behavior for that use case.

AMBudnik avatar May 07 '21 11:05 AMBudnik