Customize elementSelect Field's Modal Table Layout I am using the "Select Entry" field (_includes/forms/elementSelect.html) field in a custom plugin to select one of my custom element types.

In my ElementType, I defined defineTableAttributes() and getTableAttributeHtml() to customize the table cells on a index view of the Element.

Now when I am using this Element in a modal view, it displays the same cells as on the index view, but I would like to hide certain fields (like buttons).

Is there a way to customize the returned fields, without building the whole modal myself, like mentioned here?

I saw, that a attribute context gets passed, which is either modal or index, but I don't know how I could access it.

Thanks!
You should be able to accomplish what you want with a combination of the getTableAttributeHtml() hook and the modifyEntryTableAttributes() hook. You may be able to use the parameter $source from modifyEntryTableAttributes() to filter out index vs modal. 

Check out this post for a more detailed description.