Hide Details Buttons

Is there a way to hide the button on a detail page when the parent page status has changed upon checking on initialize?

 

I tried to create an attribute that will be set to true when the parent status is 'order processing' and bind it to the visible property of the button but it doesn't work.

 

"className": "Terrasoft.ConfigurationGrid",
"generator": "ConfigurationGridGenerator.generatePartial",
"generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
"changeRow": {"bindTo": "changeRow"},
"unSelectRow": {"bindTo": "unSelectRow"},
"onGridClick": {"bindTo": "onGridClick"},
"activeRowActions": [
	{
		"className": "Terrasoft.Button",
		"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
		"tag": "save",
		"markerValue": "save",
		"imageConfig": {"bindTo": "Resources.Images.SaveIcon"},
		"visible": {"bindTo": "IsOrderProcessing"}
	},...
init: function() {
	debugger;
	this.callParent(arguments);
 
	var orderId = this.$MasterRecordId;
	var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
		rootSchemaName: "Order"
	});
 
	esq.addColumn("Status", "Status");
	esq.getEntity(orderId, function (result) {
		debugger;
		if (!result.success) {
			this.showInformationDialog("Data query error");
			return;
		}
		if (result.entity) {
			var orderStatus = result.entity.get("Status");
 
			if (orderStatus.value === "3f7523c5-f066-4bb6-bfd8-b2156fb42f13") { // Order Processing
				this.set("IsOrderProcessing", true);
			}
			else {
				this.set("IsOrderProcessing", false);
			}
		}
 
	}, this);
}

 

Like 0

Like

1 comments

Hi Community, has anybody have an idea on this?

Show all comments