- Install using npm (or yarn)
npm install '@agile-central-technical-services/utils-field-picker' -D
- Add the file to the
javascript
section ofconfig.json
"javascript": [ "node_modules/@agile-central-technical-services/utils-field-picker/index.js", ...
To use the control on a page:
controlsArea.add({
xtype: 'tsfieldpickerbutton',
modelNames: [modelName],
context: this.getContext(),
stateful: true,
stateId: this.getViewType() + 'fields', // columns specific to type of object
alwaysSelectedValues: alwaysSelectedColumns,
listeners: {
fieldsupdated: function(fields) {
// fields is the currently selected fields from the picker
},
scope: this
}
});
To get the current selected fields:
this.down('tsfieldpickerbutton').getFields()
To Update
npm version patch
- This will update the package.json to a new version and create a git tag (e.g.v1.0.1
). It will also run thepostversion
script to push the changes and tag to GitHub.npm publish --access public
- This will publish the new version to npmjs.org- Create the new release in `utils-/releases'