Hi all,
I inserted a custom button in a section
diff: /**SCHEMA_DIFF*/[
// Metadata for adding a cutom button to the page.
{
// Indicates that an operation of adding an item to the page is being executed.
"operation": "insert",
// Meta-name of the parent control item where the button is added.
"parentName": "CombinedModeActionButtonsCardLeftContainer",
// Indicates that the button is added to the control items collection
// of the parent item (which name is specified in the parentName).
"propertyName": "items",
// Meta-name of the added button. .
"name": "MainContactButton",
// Supplementary properties of the item.
"values": {
// Type of the added item is button.
itemType: Terrasoft.ViewItemType.BUTTON,
// Binding the button title to a localizable string of the schema.
caption: {bindTo: "getSendButtonCaption"},
// Binding the button press handler method.
click: {bindTo: "onSendClick"},
// Binding the property of the button availability.
enabled: {bindTo: "canSend"},
visible: {bindTo: "showButtonSend"},
style: Terrasoft.controls.ButtonEnums.style.GREEN,
// Setting the field location.
"layout": {
"column": 1,
"row": 6,
"colSpan": 1
}
}
}
]
I have bind its caption with a function "getSendButtonCaption", but it doesn't work when I changed value
getSendButtonCaption: function() {
var activeRow = this.get("ActiveRow");
if (activeRow) {
var sendTime = this.get("GridData").get(activeRow).get("UsrSendTime");
if (sendTime) {
if (sendTime.value.toUpperCase() === "FC73B30F-9E29-48BA-8A9E-3C4247CFF22A") {
return this.get("Resources.Strings.SendManuallyButtonCaption");
} else if (sendTime.value.toUpperCase() === "47AB118D-84C9-4846-B916-8DC40CF0B333") {
return this.get("Resources.Strings.ScheduleSendButtonCaption");
}
}
}
return "";
}
This solution works well in page.Why?
Thanks