-
-
Notifications
You must be signed in to change notification settings - Fork 19
Migration to 5.x
Bye Bye jQueryUI... welcome SortableJS
NOTE: if you come from an earlier version, it is very important that you follow the migrations in order
- upgrade
aurelia-i18nto major version>=4.0.0 - replaced jQueryUI with SortableJS
- follow changes to Kraaden Autocomplete
- Why replace jQueryUI with SortableJS?
Since we removed jQueryUI and we were using jQueryUI Slider for the Filters.SliderRange, we had to remove the Slider Range since we don't have a replacement at the moment, though it might come in the future.
-
exportOptionswas renamed totextExportOptions -
enableExportwas renamed toenableTextExport
Since we replaced the jQueryUI Autocomplete with Kraaden Autocomplete (see below) and for that reason we removed a few unnecessary SASS/CSS variables that are no longer necessary and were removed.
$slick-autocomplete-box-shadow$slick-autocomplete-border-radius$slick-autocomplete-hover-color$slick-autocomplete-hover-border-color$slick-autocomplete-loading-input-bg-color$slick-autocomplete-min-width$slick-autocomplete-overflow-x$slick-autocomplete-overflow-y$slick-autocomplete-text-color$slick-autocomplete-text-overflow$slick-autocomplete-text-padding
We now require latest aurelia-i18n version >=4.0.0
"dependencies": {
- "aurelia-i18n": "^3.1.4",
+ "aurelia-i18n": "^4.0.3",
+ "i18next": "^21.8.10",
"i18next-xhr-backend": "^3.2.2",
},
"devDependencies": {
+ "@types/i18next-xhr-backend": "^1.4.2"
}If you use any of the Slickgrid-Universal extra dependencies then make sure to upgrade them to 2.0.0 so that they work with Aurelia-Slickgrid 5.0.0
"dependencies": {
- "@slickgrid-universal/excel-export": "^1.4.0",
+ "@slickgrid-universal/excel-export": "^2.0.0",
- "aurelia-slickgrid": "^4.3.0",
+ "aurelia-slickgrid": "^5.0.0",
}Here's an example of the code change that you need to do
this.gridOptions = {
- enableExport: true,
- exportOptions: {
+ enableTextExport: true,
+ textExportOptions: {
sanitizeDataExport: true
},Replaced JqueryUI Autocomplete with Kraaden Autocomplete
Since we removed, and no longer use jQueryUI, we had to find an alternative to the AutoComplete Editor/Filter and we settled on the 3rd party lib Kraaden Autocomplete which does everything that the jQueryUI one was doing. There are subtle changes which only requires couple line of changes.
You will notice that the Editor/Filter model change is nearly the same, there are 2 chars that are different (a lower c and a r at the end of the word which is forming the new word model: Editors.autocompleter)
If you were using the Autocomplete onSelect callback, it got renamed to onSelectItem. If you were using openSearchListOnFocus, then that is now simply showOnFocus with the Kraaden Autocomplete (refer to Kraaden Autocomplete options, to use them in editorOptions or filterOptions)
import {
- AutocompleteOption,
+ AutocompleterOption,
} from '@slickgrid-universal/common';
prepareGrid() {
this.columnDefinitions = [{
id: 'cityOfOrigin', name: 'City of Origin', field: 'cityOfOrigin',
filterable: true,
editor: {
- model: Editors.autoComplete,
+ model: Editors.autocompleter,
editorOptions: {
minLength: 3,
forceUserInput: true,
- source: (request, response) => {
+ fetch: (searchText, updateCallback) => {
$.ajax({
url: 'http://gd.geobytes.com/AutoCompleteCity',
dataType: 'jsonp',
data: {
- q: request.term
+ q: searchText
},
success: (data) => {
- response(data);
+ updateCallback(data);
}
});
}
- } as AutocompleteOption,
+ } as AutocompleterOption,
filter: {
- model: Filters.autoComplete,
+ model: Filters.autocompleter,
filterOptions: {
// ... the rest is the same as the Editor
}
}
}
}If you use Aurelia-CLI and RequireJS, you probably needed an entry in aurelia.json for jQueryUI, you can now safely remove it
# aurelia.json
"bundles": [
"dependencies": [
"aurelia-bootstrapper",
"aurelia-loader-default",
"aurelia-pal-browser",
{
"name": "aurelia-testing",
"env": "dev"
},
"text",
{
"name": "multiple-select-modified",
"path": "../node_modules/multiple-select-modified/src",
"main": "multiple-select",
"resources": ["multiple-select.css"]
},
{
"name": "dequal-lite",
"path": "../node_modules/dequal/dist",
"main": "index.min"
}
- {
- "name": "jquery-ui",
- "path": "../node_modules/jquery-ui",
- "main": "dist/jquery-ui",
- "deps": ["jquery"],
- "exports": "$"
- },
]
]Why replace jQueryUI with SortableJS?
Prior to this new version, we required jQueryUI to be installed, that was even for a basic grid, but the fact was that the only jQueryUI feature we needed in SlickGrid was jQueryUI - Sortable for column reordering. Considering the fact that we required the user to download jQueryUI at 281Kb (js+css) just to get column reordering, we figured it was a rather large request, don't you think? Some of you might reply, wait a minute that seems incorrect since we were also using jQueryUI Date Picker, Slider, Autocomplete & Draggable... which we could reply: indeed that was true but only partially and that was when the user decided to include Slick.Editors into their grid. Other reasons to replace jQueryUI could be that jQueryUI is barely maintained and is now quite outdated. Please note that you can still use jQueryUI if you wish, but it no longer be required by default (however SortableJS is the new default).
- old and outdated, barely supported and rather large (probably because it was written when IE5 was a thing)
- it does not support Touch that well (mobile devices)
- it is rather large at 250Kb (min.js) + 31Kb (min.css)
- much smaller at 44Kb (
min.jsdoesn't require any css) - touch friendly (mobile devices)
- much smoother UX and better performance
- written in pure JS without any dependencies
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