MobileCRM.UI.EntityList.onCellClick - Resconet/JSBridge GitHub Wiki
[v18.1] Binds or unbinds the handler for onCellClick event on EntityList.
Bound handler is called with the EntityList object as an argument. The EntityList context property contains EntityListClickContext object.
Argument | Type | Description |
---|---|---|
propertyName | String | The name of desired cell within the list item. |
handler | function(entityList) | The handler function that has to be bound or unbound. |
bind | Boolean | Determines whether to bind or unbind the handler. |
scope | Object | The scope for handler calls. |
This example demonstrates how to handle a click to a specific clickable/editable cell on entity list. It works only from iFrame placed on entity view.
MobileCRM.UI.EntityList.onCellClick("new_service_operation", function (entityList) {
var rowIndex = entityList.context.event.row;
var popup = new MobileCRM.UI.MessageBox("Service Operation");
// Add the buttons for message box
popup.defaultText = "Cancel";
popup.items = [
"Installation",
"Maintenance",
"Repair",
"Calibration",
"Inspection",
"Upgrade",
"Cleaning",
"Decommissioning",
"Consultation",
"Training"
];
// If title is too long set the 'multi-line' to true
popup.multiLine = true;
popup.show(function (button) {
// update entity property
MobileCRM.UI.EntityList.setEntityProperty(rowIndex, "new_service_operation", popup.items.indexOf(button), false, function (error) {
MobileCRM.bridge.alert("An error occurred: " + error);
});
});
}, true);