-
-
Notifications
You must be signed in to change notification settings - Fork 19
Migration from 1.x to 2.x
Ghislain B edited this page May 23, 2018
·
56 revisions
Migration Changes Guide from version 1.x
to 2.x
- Aurelia-Slickgrid Services are no longer Singleton and are no longer available as Dependency Injection (DI) anymore, they are instead available in the Aurelia Grid Instance that can be obtained by the
onAureliaGridCreated
Event Aggregator (or Event Dispatch)- not finalized, we will see when we get there (discussion is all in #36 )
-
GridExtraService
got renamed toGridService
-
GroupingAndColspanService
got renamed toGroupingService
-
ControlAndPluginService
got renamed toPluginService
- not finalized this might end up being split into 2 Services
-
GridExtraUtil
no longer exist, it was containing only 1 functiongetColumnDefinitionAndData()
that got moved into theGridService
and renamed togetColumnFromEventArguments
- all the Editors options were previously passed through the generic
params
property. To bring more TypeScript Types, all of these options got moved into theeditor
options (see below)
- For consistencies, all Grid Menu
showX
flags were renamed tohideX
to align with some of the SlickGridhideX
(see (below](/ghiscoding/aurelia-slickgrid/wiki/Migration-from-1.x-to-2.x#grid-menu-showx-renamed-to-hidex)) -
exportWithFormatter
is no longer available directly in the Grid Options, it is now underexportOptions
Grid Options (see below)
- For
BackendServiceApi
, theservice
property now as to contain anew
instance of the Backend Service that you want to use (GraphqlService
orGridOdataService
). See explanation below - All 3
onX
service methods were renamed toprocessOnX
to remove confusion withonX
Event Emitters with the same names. (see below)- this will probably not concern you, unless you built your own custom Backend Service API
-
BackendService
methodinitOptions
got removed and replaced byinit
which has a different argument signature
export class MyGrid {
- constructor(private graphqlService: GraphqlService, private i18n: I18N) {
+ constructor(private i18n: I18N) {
}
this.gridOptions = {
backendServiceApi: {
- service: this.graphqlService,
+ service: new GraphqlService(),
preProcess: () => this.displaySpinner(true),
process: (query) => this.getCustomerApiCall(query),
postProcess: (result: GraphqlResult) => this.displaySpinner(false)
},
params: {
i18: this.translate
}
};
Previously available directly in the grid options but is now accessible only from the exportOptions
property
this.gridOptions = {
- exportWithFormatter: true
exportOptions: {
+ exportWithFormatter: false,
}
};
This was already renamed long time ago but was still available. It is now removed, if you have any references simply change selectOptions
to collection
// column definitions
this.columnDefinitions = [
{
id: 'isActive', name: 'Is Active', field: 'isActive',
type: FieldType.boolean,
filterable: true,
filter: {
- selectOptions: [ { value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' } ],
+ collection: [ { value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' } ],
type: FilterType.multipleSelect,
searchTerms: [], // default selection
}
}
];
Since these flags are now inverse, please do not forget to also inverse your boolean
value. Here is the entire list
-
showClearAllFiltersCommand
renamed tohideClearAllFiltersCommand
-
showClearAllSortingCommand
renamed tohideClearAllSortingCommand
-
showExportCsvCommand
renamed tohideExportCsvCommand
-
showExportTextDelimitedCommand
renamed tohideExportTextDelimitedCommand
-
showRefreshDatasetCommand
renamed tohideRefreshDatasetCommand
-
showToggleFilterCommand
renamed tohideToggleFilterCommand
Here is the entire list
-
onFilterChanged
was renamed toprocessOnFilterChanged
-
onPaginationChanged
was renamed toprocessOnPaginationChanged
-
onSortChanged
was renamed toprocessOnSortChanged
Contents
- Aurelia-Slickgrid Wiki
- Installation
- Styling
- Interfaces/Models
- Testing Patterns
- Column Functionalities
- Global Grid Options
- Localization
- Events
- Grid Functionalities
- Auto-Resize / Resizer Service
- Resize by Cell Content
- Add/Delete/Update or Highlight item
- Dynamically Change Row CSS Classes
- Column Picker
- Composite Editor Modal
- Context Menu
- Custom Tooltip
- Excel Copy Buffer
- Export to Excel
- Export to File (CSV/Txt)
- Grid Menu
- Grid State & Presets
- Grouping & Aggregators
- Header Menu & Header Buttons
- Header Title Grouping
- Pinning (frozen) of Columns/Rows
- Row Colspan
- Row Detail
- Row Selection
- Tree Data Grid
- SlickGrid & DataView objects
- Addons (controls/plugins)
- Backend Services