![]() |
#1 |
Участник
|
mscrmblog: Add a double click event handler to a Subgrid in CRM 2013
Источник: http://mscrmblog.net/2015/01/13/add-...d-in-crm-2013/
============== Had an interesting problem we had a middle entity that linked two other entities together however we didn’t really want people to get to that entity when double clicking on the row in the grid. Use the following function and you can override the double click event. function OverrideDoubleClickClientsGrid() { if (document.getElementById("ClientGrid")) { var grid = document.getElementById("ClientGrid"); grid.ondblclick = function () { var gridControl = document.getElementById("ClientGrid").control; var selectedClientOutletId = ""; for (var rowNo = 0; rowNo < gridControl.get_selectedRecords().length; rowNo++) { selectedClientOutletId = gridControl.get_selectedRecords()[rowNo].Id; } if (selectedClientOutletId != "" && selectedClientOutletId != null) { alert(selectedClientOutletId); // You can add your logic in here and open the other record in the same window. // for example based on the selected id, retrieve it, get the lookup entity and open that entity form //Xrm.Utility.openEntityForm(entityName, entityId) } }; } else { setTimeout("OverrideDoubleClickClientsGrid();", 1000); }} Источник: http://mscrmblog.net/2015/01/13/add-...d-in-crm-2013/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|