Add dropdownMenu in RowHeader

Tags: #<Tag:0x00007efc656321e0>

Hello,

is it possible to add a dropdownMenu in row headers not only in column headers?
I want to perform actions on individual rows, but put them in a dropdown and not in the context menu.
Like in this fiddle only in the rows -> https://jsfiddle.net/o86hbdmp/

Thanks in advance!

Hi @julian.aiglsdorfer

Generally, this option is added to all of the columns. If you do not want to show an option within the menu to a certain column you can use the hidden option like in this example http://jsfiddle.net/ou8wmby6/3/. You can also hide the dropdown menu icon via CSS, but we do not recommend it, as it is rather a hack.

Thank you for the quick reply.

I think my description was a bit misleading - sorry for that, I wanted to know if a dropdown menu is also possible in row headers not in column headers?

At the moment you can only add them to column headers.

Nevertheless, the afterGetRowHeader hook allows altering the row header to attach any HTML elements so you are able to attach your own logic there. What type of logic you would like to be handled row-wise?

Do you know if it is intended to implementing this feature so that you can use a dropdownMenu in rowHeaders as well?

I want to make individual rows readonly with a checkbox in a dropdownMenu in the rowHeader. So that I can read out at validation which rows are readonly to perform actions on them.
Maybe i can realize this with the afterGetRowHeader-hook, thank you!

We do not have plans on adding dropdownMenu to the row headers so the afterGetRowHeader might be the only option. If you want to have only one checkbox to alter the readOnly state I would recommend using the afterOnCellMouseDown hook to attach the setCellMeta()row, column, readOnly, true row loop once the event.target === your checkbox.

I do not have a specific demo. But if you own an active Ultimate/Extended Support plan it grants you the ability to request such a demo.

All right, it’s a bit misleading though since commands like row_above and row_below are also available in the dropdownMenu. It would be nice if this function is included in the rowHeaders.

With afterGetRowHeader I think it won’t work because this hook is called several times and so my html element is appended again and again.

Thanks anyway for your information!

You can also use the rowHeaders like a function

Example

rowHeaders: function(visualRowIndex) {
  return `${visualRowIndex}: AB`;
},