Skip to content

Instantly share code, notes, and snippets.


Marco Celotti mcelotti

  • Udine
View GitHub Profile
mcelotti / GridPagingToolbar.js
Last active Aug 6, 2017
ExtJS6 Modern: Ext.grid.plugin.PagingToolbar that interacts with grid's store
View GridPagingToolbar.js
* When I first used the "Ext.grid.plugin.PagingToolbar" plugin with ExtJS6.2 modern I thought it could interact and load prev/next pages using the grid's store.
* The fact is that the pagingtoolbar does not interact with the store, it splits "pages" of data within the current grid data, but this is not what I was looking for.
* Therefore here's my attempt to extend the PagingToolbar and create a paging plugin that actually loads store pages according to the slider.
Ext.define('MyApp.util.GridPagingToolbar', {
extend: 'Ext.grid.plugin.PagingToolbar',
mcelotti / android_forward_result
Last active Nov 2, 2021
View android_forward_result
Nav flow is: A => B => C => A with results from C
If you're using fragments please note that "onActivityResult" will be called according to where "startActivityForResult" is called (method "startActivityForResult" is available in both, activity and fragment)
startActivityForResult(intentB, 22);
mcelotti / Model.js
Last active Nov 20, 2015
Sencha Touch 2.4.2 override validate() to pass model and allow cross-field validation
View Model.js
Ext.define('', {
override : '',
* @override
* we want to pass the model (not only config and value)
validate : function() {
var errors = Ext.create(''),
validations = this.getValidations().items,
View Ext.ux.TimestampIdentifier.js
Ext.define('Ext.ux.TimestampIdentifier', {
alias : 'data.identifier.timestamp',
config : {
negative : false,
string : true
constructor : function(config) {
View Ext.ux.Base64.js
//jshint camelcase:false
Ext.define('Ext.ux.Base64', {
singleton : true,
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode : function(e) {
var t = "";
var n,
View Ext.ux.CanvasImage.js
(function() {
var drawImage = function() {
var imageData = this.getImgData();
var maxWidth = this.getWidth();
var maxHeight = this.getHeight();
if (imageData && maxHeight && maxWidth) {
var img = document.createElement("img");
img.src = imageData;