Conditional visible actions in mobile

Hi Team ,

 

There is any way to do conditional the visibility of the actions in the mobile page?

Like 0

Like

3 comments

Found it. You can override the funtion:

	pageLoadComplete: function() {
		this.callParent(arguments);
		var view = this.getView();	
//THIS WILL SET THE ACTIONS HIDE
				view.setActionsHidden(true);
	},

But seams to be falling in this point once is remove it.

 

Any ideas?

 

Federico Buffa ?,

 

The code seems to be correct:

 



pageLoadComplete: function() {

        var view = this.getView();

        var gridView = view.getGrid();

        if (Terrasoft.PageNavigator.getLastPageController() === this) {

            view.setActionsHidden(false);

            if (gridView instanceof Ext.Component) {

                gridView.deselect(gridView.getSelection());

            }

        }

        this.callParent(arguments);

    },

 

 

What I could recommend you change is to place

 

view.setActionsHidden(false); 

before the

this.callParent(arguments);

 

Please try this change and let us know if it helped.

 

Best Regards,

Dan

Is the same behaivor. Here is my updated code if you want to test it.

 

 

Ext.define("Terrasoft.controller.UsrCustomManagementPreviewPage", {
	override: "Terrasoft.controller.BasePreviewPage",
	inheritableStatics: {
 
		isCacheable: function() {
			return false;
		}
 
	},
 
	getChangeModeOperations: function() {
 
		var detailConfig = this.getDetailConfig();
		if (detailConfig && detailConfig.parentRecord && detailConfig.parentRecord.data.UsrCustomStatus && detailConfig.parentRecord.data.UsrCustomStatus.data.Id) {
			var parentRecord = detailConfig.parentRecord;
			if ( parentRecord.data.UsrCustomStatus.data.Id && parentRecord.data.UsrCustomStatus.data.Id !== "f50b9fd6-21ed-47ff-8450-e7f5f9c82c5f") {
 
				return {
					canCreate: false,
					canUpdate: false,
					canDelete: false
				};
			}
		}
		return this.callParent(arguments);
	},
 
	pageLoadComplete: function() {
 
		var view = this.getView();
		var detailConfig = this.getDetailConfig();
		if (detailConfig && detailConfig.parentRecord && detailConfig.parentRecord.data.UsrCustomStatus && detailConfig.parentRecord.data.UsrCustomStatus.data.Id) {
			var parentRecord = detailConfig.parentRecord;
			if (view.$className == "Terrasoft.configuration.view.UsrCustomDetailSectionPreviewPage" && parentRecord.data.UsrCustomStatus.data.Id && parentRecord.data.UsrCustomStatus.data.Id !== "f50b9fd6-21ed-47ff-8450-e7f5f9c82c5f") {
 
	//			view.setActionsHidden(true);
			} else {
//				view.setActionsHidden(false);
			}
		}
		this.callParent(arguments);
	},

 

Show all comments