Lookup List not editable

Hello Friends,

 

I was create Pre-configure page and inside i add lookup list. 

Inside the list i have 3 options but when i will choose for example first one i can rename text option or delete. I want block for user possible to edit or delete option from choosen lookup. I was try use readonly setting but this only block all area

Grats

Przemek
Like 0

Like

2 comments

UP ?

Dear Przemek,

In order to achieve such task you need to set logic, which will change the field's enable property depending on the actions. Such customization can be done using development,. Please see the example below, where list lookup field "Salutation Type" becomes locked after user sets the value. In this case user won't have an ability to delete or change picked value:

define("ContactPageV2", [],
	function() {
		return {
			entitySchemaName: "Contact",
			attributes: {
				"isSalutationEnabled": {
					type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
					dataValueType: Terrasoft.DataValueType.BOOLEAN,
					value: true
				}
			},
			methods: {
				onEntityInitialized: function() {
					this.callParent(arguments);
					this.on("change:SalutationType", this.fieldChanged, this);
				},
				fieldChanged: function() {
					this.set("isSalutationEnabled", false);
					//add other logic if needed 
				}
			},
			diff: /**SCHEMA_DIFF*/[
				{
					"operation": "merge",
					"parentName": "ContactGeneralInfoBlock",
					"propertyName": "items",
					"name": "SalutationType",
					"values": {
						"contentType": Terrasoft.ContentType.ENUM,
						"enabled": {"bindTo": "isSalutationEnabled"},
						"layout": {
							"column": 0,
							"row": 1
						}
					}
				}
			]/**SCHEMA_DIFF*/
		};
	});

 

Regards,

Anastasia

Show all comments