Skip to content

Commit 91c9ac6

Browse files
authored
Merge pull request #200 from mathiasbl/gh_master
typings for onlookuptagclick and onload event args
2 parents f6dc67d + 801cc4b commit 91c9ac6

3 files changed

Lines changed: 55 additions & 2 deletions

File tree

src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,6 @@ declare namespace Xrm {
945945
saveMode?: SaveMode;
946946
}
947947

948-
interface OnLoadEventContext extends ExecutionContext<UiModule<TabCollectionBase, ControlCollectionBase>, any> { }
949-
950948
/**
951949
* Interface for the data of a form.
952950
*/

src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-9.1-.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ declare namespace Xrm {
77
*/
88
securityRoles: string[];
99
}
10+
11+
interface OnLoadEventContext extends ExecutionContext<UiModule<TabCollectionBase, ControlCollectionBase>, any> { }
1012
}

src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,57 @@ declare namespace Xrm {
3131
*/
3232
setIsValid(bool: boolean, message?: string): void;
3333
}
34+
35+
const enum LoadState {
36+
InitialLoad = 1,
37+
Save = 2,
38+
Refresh = 3,
39+
}
40+
41+
interface LoadEventArgs {
42+
/**
43+
* Gets the state of the data load.
44+
*/
45+
getDataLoadState(): LoadState;
46+
}
47+
48+
interface OnLoadEventContext extends ExecutionContext<UiModule<TabCollectionBase, ControlCollectionBase>, LoadEventArgs> { }
49+
50+
interface LookupTagValue extends Lookup {
51+
/**
52+
* The originating lookup field that raised the event.
53+
*/
54+
fieldName: string;
55+
}
56+
57+
interface OnLookupTagClickEventArgs {
58+
/**
59+
* Gets the selected tag value.
60+
*/
61+
getTagValue(): LookupTagValue;
62+
63+
/**
64+
* Returns a value indicating whether the lookup tag click event has been canceled because the preventDefault method was used in this event hander or a previous event handler.
65+
*/
66+
isDefaultPrevented(): boolean;
67+
68+
/**
69+
* Cancels the lookup tag click event, but all remaining handlers for the event will still be executed.
70+
*/
71+
preventDefault(): void;
72+
}
73+
74+
interface OnLookupTagClickContext extends ExecutionContext<any, OnLookupTagClickEventArgs> { }
75+
76+
interface LookupControl<T extends string> extends Control<LookupAttribute<T>> {
77+
/**
78+
* Adds an event handler to the OnLookupTagClick event.
79+
*/
80+
addOnLookupTagClick(myFunction: (context?: OnLookupTagClickContext) => any): void;
81+
82+
/**
83+
* Removes an event handler from the OnLookupTagClick event.
84+
*/
85+
removeOnLookupTagClick(functionRef: Function): void;
86+
}
3487
}

0 commit comments

Comments
 (0)