Skip to content

Instantly share code, notes, and snippets.

View StErMi's full-sized avatar
🔥
let's go!

StErMi StErMi

🔥
let's go!
View GitHub Profile
@StErMi
StErMi / Component.js
Created July 14, 2016 10:43
Example of loading local JSON data from the Component.js
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/model/json/JSONModel"
], function(UIComponent, JSONModel) {
"use strict";
return UIComponent.extend("com.openui5.example.Component", {
metadata: {
manifest: "json"
@StErMi
StErMi / manifest.json
Last active February 15, 2018 12:53
Example of manifest.json to directly load a local json inside a component model
{
"_version": "1.1.0",
"sap.app": {
"dataSources": {
"init_data_alias": {
"uri": "model/init_data.json",
"type": "JSON"
}
}
},
/**
* @module it/designfuture/framework/controls
* @author Emanuele Ricci <stermi@gmail.com>
* @version 0.0.1
*/
// Provides control it.designfuture.framework.controls.DFStandardListItem.
sap.ui.define([
'sap/m/StandardListItem'
], function(StandardListItem) {
"headerWhiteList": [
"slug"
]
@StErMi
StErMi / manifest.json
Created April 6, 2017 08:00
openui5-flatpickr manifest.json configuration
"sap.ui5": {
...
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
...
"it.designfuture.flatpickr": {}
}
},
"resourceRoots": {
@StErMi
StErMi / View.xml
Created April 6, 2017 08:03
FlatDatePicker inside a View.xml example
<df:FlatDatePicker
class="sapUiMediumMargin"
clickOpens="false"
dateFormat="d/m/Y"
/>
@StErMi
StErMi / openui5-flatpickr-parameters.md
Created April 6, 2017 08:27
openui5-flatpickr Parameters
Name Type Default Description
altFormat string "F j, Y" Exactly the same as date format, but for the altInput field
altInput boolean false Show the user a readable date (as per altFormat), but return something totally different to the server
altInputClass string "" This class will be added to the input element created by the altInput option. Note that altInput already inherits classes from the original input
allowInput boolean false Allows the user to enter a date directly input the input field. By default, direct entry is disabled
clickOpens boolean false Whether clicking on the input should open the picker. You could disable this if you wish to open the calendar manually with.open()
dateFormat string "Y-m-d" A string of characters which are used to define how the date will be displayed in the input box. The supported characters are defined in the table below.
dateValue object null Set the in
@StErMi
StErMi / openui5-flatpickr-methods.md
Created April 6, 2017 08:28
openui5-flatpickr Methods
Name Description
clear Resets the selected dates (if any) and clears the input
open Shows/opens the calendar
close Closes the calendar
destroy Destroys the Flatpickr instance, cleans up - removes event listeners, restores inputs, etc
formatDate Return a formatted date
jumpToDate Sets the calendar view to the year and month ofdate, which can be a date string, a Date, or nothing. If date is undefined, the view is set to the latest selected date, the minDate, or today’s date
parseDate Parses a date string or a timestamp, and returns a Date
redraw Redraws the calendar. Shouldn’t be necessary in most cases
@StErMi
StErMi / openui5-flatpickr-events.md
Created April 6, 2017 08:29
openui5-flatpickr Events
Name Description
onChange onChange gets triggered when the user selects a date, or changes the time on a selected date
onOpen onOpen gets triggered when the calendar is opened
onClose onClose gets triggered when the calendar is closed
onMonthChange onMonthChange gets triggered when the month is changed, either by the user or programmatically
onYearChange onYearChange gets triggered when the year is changed, either by the user or programmatically
onReady onReady gets triggered once the calendar is in a ready state
onValueUpdate onValueUpdate gets triggered when the input value is updated with a new date string
onDayCreate Take full control of every date cell with the onDayCreate() hook
@StErMi
StErMi / package.json
Created May 15, 2017 10:11
openui5-qrcode package.json
{
"name": "openui5-qrcode",
"version": "0.0.1",
"description": "An openui5 custom control to render a QR Code",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/StErMi/openui5-qrcode"
},
"keywords": [