i need to disable a button after it is clicked once without refreshing a page.
Like
2 comments
17:26 Feb 15, 2022
Add a boolean attribute to the page:
attributes: { "IsButtonEnabled": { dataValueType: Terrasoft.DataValueType.BOOLEAN, type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN, value: true } }
Then bind the enabled property of the button to the attribute:
{ "operation": "insert", "parentName": "Header", "propertyName": "items", "name": "MyButton", "values": { "itemType": Terrasoft.ViewItemType.BUTTON, "caption": "My button", "click": {"bindTo": "onMyButtonClick"}, "enabled": {"bindTo": "IsButtonEnabled"} } }
Now when it is clicked, set the attribute to false:
onMyButtonClick: function() { this.set("IsButtonEnabled", false); }
Ryan
Show all comments