@resconet/jsbridge 18.1.0-beta.1 → 18.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/JSBridge.d.ts +10 -0
- package/src/JSBridge.js +18 -0
package/package.json
CHANGED
package/src/JSBridge.d.ts
CHANGED
|
@@ -2446,6 +2446,16 @@ declare module MobileCRM.UI {
|
|
|
2446
2446
|
* @param scope The scope for handler calls.
|
|
2447
2447
|
*/
|
|
2448
2448
|
public static onClick(handler: (entityList: EntityList) => void, bind: boolean, scope?: any);
|
|
2449
|
+
/**
|
|
2450
|
+
* @since 18.1
|
|
2451
|
+
* Binds or unbinds the handler for onCellClick event on EntityList.
|
|
2452
|
+
* Bound handler is called with the EntityList object as an argument. The EntityList context object contains "entities" property with the list of clicked entities (just one entity), property "propertyName" with the field name that was clicked within the list item and property "event" with event details.
|
|
2453
|
+
* @param propertyName The name of desired cell within the list item. (mostly logical name of the field).
|
|
2454
|
+
* @param handler The handler function that has to be bound or unbound.
|
|
2455
|
+
* @param bind Determines whether to bind or unbind the handler.
|
|
2456
|
+
* @param scope The scope for handler calls.
|
|
2457
|
+
*/
|
|
2458
|
+
public static onCellClick(propertyName: string, handler: (entityList: EntityList) => void, bind: boolean, scope?: any);
|
|
2449
2459
|
/**
|
|
2450
2460
|
* @since 10.0
|
|
2451
2461
|
* Asynchronously gets the list of entities that were changed on the list.
|
package/src/JSBridge.js
CHANGED
|
@@ -4990,6 +4990,24 @@
|
|
|
4990
4990
|
MobileCRM.bridge.command("registerEvents", "onClick");
|
|
4991
4991
|
}
|
|
4992
4992
|
};
|
|
4993
|
+
MobileCRM.UI.EntityList.onCellClick = function (propertyName, handler, bind, scope) {
|
|
4994
|
+
/// <summary>[v18.1] Binds or unbinds the handler for onCellClick event on EntityList.</summary>
|
|
4995
|
+
/// <remarks>Bound handler is called with the EntityList object as an argument. The EntityList context property contains <see cref="MobileCRM.UI.EntityListClickContext">EntityListClickContext</see> object.</remarks>
|
|
4996
|
+
/// <param name="propertyName" type="String">The name of desired cell within the list item.</param>
|
|
4997
|
+
/// <param name="handler" type="function(entityList)">The handler function that has to be bound or unbound.</param>
|
|
4998
|
+
/// <param name="bind" type="Boolean">Determines whether to bind or unbind the handler.</param>
|
|
4999
|
+
/// <param name="scope" type="Object">The scope for handler calls.</param>
|
|
5000
|
+
var handlerName = "onCellClick:" + propertyName;
|
|
5001
|
+
var handlers = MobileCRM.UI.EntityList._handlers[handlerName];
|
|
5002
|
+
if (!handlers) {
|
|
5003
|
+
MobileCRM.UI.EntityList._handlers[handlerName] = handlers = [];
|
|
5004
|
+
}
|
|
5005
|
+
var register = handlers.length == 0;
|
|
5006
|
+
_bindHandler(handler, handlers, bind, scope);
|
|
5007
|
+
if (register) {
|
|
5008
|
+
MobileCRM.bridge.command("registerEvents", handlerName);
|
|
5009
|
+
}
|
|
5010
|
+
};
|
|
4993
5011
|
MobileCRM.UI.EntityListClickContext = function () {
|
|
4994
5012
|
/// <summary>Represents a context for the <see cref="MobileCRM.UI.EntityList.onClick">MobileCRM.UI.EntityList.onClick</see> handler.</summary>
|
|
4995
5013
|
/// <field name="entities" type="Array">Single item array containing the <see cref="MobileCRM.DynamicEntity">DynamicEntity</see> object representing clicked entity.</field>
|