This topic is locked

Hide edit button based on show/hide status of column

12/26/2022 11:10:18 AM
ASPRunner.NET General questions
T
Tim author

Hello,

I need to show/hide the edit button (in every row) based on the show/hide status of a column. The list page has the "Allow show/hide fields on page" setting turned on.

This is what I've tried in the Javascript Onload event of the list page:

var col = pageObj.findItem( 'grid_field_ColumnHeader' );

if (col)
{
pageObj.toggleItem("grid_edit", true);
} else
{
pageObj.toggleItem("grid_edit", false);
}

But it appears that the findItem API always finds the item 'grid_field_ColumnHeader' whether or not it is displayed on the page. Is there a way to determine the show/hide toggle state of a particular field?

Thanks,
Tim

fhumanes 12/26/2022

Hello,

Although I use Phprunner, I suppose it is similar to yours.

For what you indicate, I use the event "Is Record Editable".

img alt

Regards,
fernando

admin 12/26/2022

The column is always there, it is just not shown at the moment.

I don't think we have an API for this specific task. You can try usin plain jQuery for this, i.e. checking the column width etc.