Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please clarify how to disable default controls (popout, maximize) of individual items/components #491

Closed
stefaneidelloth opened this issue Mar 8, 2019 · 4 comments
Labels
Documentation We need to describe stuff. Help Wanted Open to suggestions and help from others kind/feature Small fixes and features

Comments

@stefaneidelloth
Copy link

stefaneidelloth commented Mar 8, 2019

In following closed issue it has been asked how to hide default controls:

#38

However, the given solution

container.parent.parent.header.controlsContainer.find( '.lm_maximise').hide();

Did not work for me (container.parent.parent has no header property.) I guess that the
structure somehow changed.

I would expect that I can disable the controls not only globally but also in the configuration of an item, similar to isClosable:

{
  type : 'component',
  componentName : 'Progress',  
  isClosable: false,
  showPopoutIcon: false,
  showMaximiseIcon: false								
}

=>Please allow to modify the controls of individual items in the configuration or

=> Give an example on how to use the find( '.lm_maximise').hide(); workflow correctly.

@stefaneidelloth
Copy link
Author

stefaneidelloth commented Mar 8, 2019

The new structure seems to be

var layoutSettings = container.layoutManager.config.settings;
		layoutSettings.showMaximiseIcon = false;
		layoutSettings.showPopoutIcon = false;	

However, that will not only affect the current item but also all following items.
As a work around I enabled the options for the next item.

myLayout.registerComponent('Progress', function(container) {		
	var element = container.getElement();
	element.attr('id','progress');

	var layoutSettings = container.layoutManager.config.settings;
	layoutSettings.showMaximiseIcon = false;
	layoutSettings.showPopoutIcon = false;				
});
	
myLayout.registerComponent('Graphics', function(container) {
	var element = container.getElement();

	var layoutSettings = container.layoutManager.config.settings;
	layoutSettings.showMaximiseIcon = true;
	layoutSettings.showPopoutIcon = true;
}); 

@stefaneidelloth stefaneidelloth changed the title Please clarify to disable default controls (popout, maximize) Please clarify how to disable default controls (popout, maximize) of individual items/components Mar 8, 2019
@mwri
Copy link
Contributor

mwri commented Mar 25, 2019

You can disappear your maximise control with .lm_controls .lm_maximise { display: none; };. I expect .lm_controls .lm_popout { display: none; }; will do away with your popout, though I've not done that, I don't use popouts.

@sagunpandey
Copy link

@stefaneidelloth This still works -

this.container.parent.parent['header'].controlsContainer.find( '.lm_popout').hide();

Instead of using .header just use ['header'].

@martin31821 martin31821 added Documentation We need to describe stuff. kind/feature Small fixes and features Help Wanted Open to suggestions and help from others labels Jan 30, 2020
@ForbiddenEra
Copy link

ForbiddenEra commented Oct 20, 2020

I don't think using CSS to hide it is the right solution [@mwri]

@stefaneidelloth's solution seems the best but seems odd to have 'isClosable' in item config but only able to set the others in the global layout when using the config.

I'm not sure if there's a programmatic reason or anything why it isn't/can't be that way but, I think it would be better; different windows or sections of an app layout can have different purposes, you may want some windows to not be movable/closeable/popoutable (or even sizable)

Aside, I think this could be useful for all items, at least like selection/reorder. It's convenient to use the configuration to define everything and while it's not hard to set the values within the component on instantiation, it seems like the configuration is sort of fragmented. Eg, I set isClosable: false in the item config but I also have to set showMaximiseIcon and showPopoutIcon in my component function..

I would think many applications would perhaps want the settings across their whole layout, but it seems some want to do it on individual items.

edit: I just realized when I set reorderEnabled even within a specific component, unlike popout/maximize, it seems to have affected the whole layout. I suppose someone could put Windows they don't want moved in a separate layout but they may want them sizeable and not movable or vice versa. Ideally, I'll want windows that can be moved/sized/maximized and even popped out (leaving a placeholder too would be great), some that can't be moved, and some that can only be dropped on to certain targets or areas. For example, my app should have a main data table window in the center, surrounded by data list panes on the left and right with a console window at the bottom, the list panes can be moved or stacked on each other but not dropped onto the table area or console area. I could create a separate layout for each one but if they're on the left and right than they can't really be part of the same layout.. kind of a bit of a tangent here, perhaps I should make a separate issue.

I also should mention I find the spelling of 'maximise' odd, as my entire experience with computing to this point (~30 years) I've never seen it spelled that way in any context let alone a computing one.

sn/ot: Anyone else thing it's weird that it's movable and not moveable? or closeable and not closable?

@pbklink pbklink closed this as completed Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation We need to describe stuff. Help Wanted Open to suggestions and help from others kind/feature Small fixes and features
Projects
None yet
Development

No branches or pull requests

6 participants