Names
baseQueryDef | fields, extensions and other settings used across all tabs |
clientQueryDef | condition and settings from client side, represents user input/choices |
queryDef | final set of settings that represents a blend of baseQueryDef and clientQueryDef |
myStuffQuery | instance of MyStuffQuery or other class inherited from it |
myStuffQueryFields | instance of MyStuffQueryFields or other class inherited from it |
retrievedData | data retrieved from SQL using MyStuffQuery |
extensions | MyStuffQuery extensions specified in baseQueryDef that allow to add shown/sortable/searchable fields or add complex custom conditions |
OOTB widget | Out-of-the-box widget based on MyProjectsWidget |
Customization points of MyProjectsWidget
Recommended
Method | Arguments | Result | Used For | Notes |
---|---|---|---|---|
getBaseQueryDef | baseQueryDef | baseQueryDef customization | turned off if baseQueryDef customization through obsolete init is used | |
retrieveExtendedData | myStuffQuery, retrievedData | retrievedData | additional data for UI | is generally slower than extensions, retrieved data cannot be searched or sorted by |
makeQueryDefinition | clientQueryDef, options, overrides | queryDef | queryDef customization based on UI settings/choices |
Not recommended
Method | Arguments | Result | Used For | Alternatives | Notes |
---|---|---|---|---|---|
makeMyStuffQuery | queryDef, fieldsOnly | fieldsOnly ? instance of MyStuffQueryFields : instance of MyStuffQuery | various aspects of widget backend behavior | corresponding recommended methods and extensions | |
updateProjectsQuery | myStuffQuery | myStuffQuery | myStuffQuery customization | same as makeMyStuffQuery |
Obsolete but supported
Method | Arguments | Result | Used For | Alternatives | Notes |
---|---|---|---|---|---|
init | baseQueryDef | baseQueryDef customization | getBaseQueryDef | getBaseQueryDef is turned off if this method is used |
Where to start?
Most widgets consist of a client-side descendant of MyProjectsWidgetGeneric and a server-side descendant of MyProjectsWidget.
What is starting point of a widget based on MyProjectsWidget?
Extend MyProjectsWidget class, overload getBaseQueryDef method, and expose instance of your new class, e.g.:
What is starting point for customization of an OOTB widget?
Extend OOTB widget class, overload getBaseQueryDef method, and expose instance of your new class:
Or when customizing the requests widget use the following to expose instance.
Basics
How to add fields?
How to remove fields from OOTB widgets?
How to redefine one of the properties of a field from OOTB widget?
How to add an extension?
How to remove already added extension?
Currently, there is no way to do it except to use override and remove all base extensions. Also, it can be used by some base code somewhere so it may break something.
How to customize onlyAssignedToRoles, onlyAssignedToRolesOtherThan or queryParts ?
How to configure search/sort?
How to configure what fields are used in Quick Search (Full Text Search)?
How to add a field to search through Search dialog?
How to configure exact match for string field search?
How to configure drop list for a field shown in the search window?
How to add a field to list of sortable fields?
How to control position where the field will be shown in search dialog or sort popup?
Specify name of the field after which you want to put yours:
or a numeric index (less preferable), check base widget class for existing indexes:
How to add search/sort by customer name if primary type has 'Customer_Code' or 'Customer Code' field?
(for other cases see Advanced section below)
Advanced
How to add a filter to all tabs (except favorites)?
To extend base filters:
How to add a custom tab?
On client side specify your new tab like:
On server side overload MyProjectsWidget.makeQueryDefinition method:
How to add additional shown/non-searchable/non-sortable data that is not a part of primary type?
Option #1: write an extension, fastest but hardest to write:
Option #2: overload MyProjectsWidget.retrieveExtendedData method, slowest but easy to write:
Option #3: specify 'expression' with sql expression in field definition, fast for simple cases, slow for complex:
How to add additional shown/searchable/non-sortable field that is not a part of primary type?
Option #1: write an extension, fastest but hardest to write:
Option #2: specify 'expression' with sql expression in field definition, fast for simple cases, slow for complex:
How to add additional shown/searchable/sortable field that is not a part of primary type?
Client side customizations
Specifying a custom header row
A header template may be specified when customizing the MyProjectsWidgetGeneric descendant used for the widget in question and specifying a "headerTemplate" property in the super calls args. For example:
Enabling custom lines in widget
In client side code the LineViewModel used by the desired widget should be extended, with the init function setting the values of useDefaultMinLine and useDefaultFullLine when calling super. Example for job widget: