Skip to content

Instantly share code, notes, and snippets.

View mitchellsimoens's full-sized avatar

Mitchell Simoens mitchellsimoens

View GitHub Profile
@mitchellsimoens
mitchellsimoens / server.js
Created October 21, 2011 15:56
Basic server that body is undefined
//nodejs v0.4.13-pre
//express 2.4.7
var express = require('express'),
server = express.createServer(
express.bodyParser(),
express.methodOverride()
);
server.post('/', function(req, res) {
@mitchellsimoens
mitchellsimoens / gist:1394360
Created November 25, 2011 20:27
LoadMask to display when grid is rendered but store is not done loading.
Ext.override(Ext.LoadMask, {
onBeforeLoad: function() {
var me = this;
if (!me.disabled) {
me.loading = true;
}
me.callOverridden(arguments);
}
@mitchellsimoens
mitchellsimoens / gist:1394471
Created November 25, 2011 21:37
Ext.form.field.ComboBox doQuery fix [4.0.7] [4.1.0 PR1]
/**
* @author Mitchell Simoens (mitchell.simoens@sencha.com)
*
* This override is to make {@link Ext.form.field.ComboBox} not disrupt
* existing filters on a {@link Ext.data.Store}.
*
* This override only affects the {@link Ext.form.field.ComboBox} if
* queryMode = 'local' and triggerAction = 'query'.
*
* Ext JS versions tested: 4.0.7, 4.1.0 PR1, SDK repo (2011-11-25)
@mitchellsimoens
mitchellsimoens / gist:2502066
Created April 26, 2012 19:09
Quick form example
Ext.define('Test.field.Countries', {
extend : 'Ext.form.field.ComboBox',
alias : 'widget.field-countries',
fieldLabel : 'Countries',
queryMode : 'local',
displayField : 'name',
valueField : 'abbr',
store : {
xclass : 'Ext.data.Store',
@mitchellsimoens
mitchellsimoens / gist:3137945
Created July 18, 2012 18:33
Extending Ext.plugin.PullRefresh
/**
* You were close except since you had override, it was going to try and override all Ext.plugin.PullRefresh.
*
* Here is an example at extending it, you are making a new class. So instead of creating Ext.plugin.PullRefresh, you would use mobuy.plugin.PullRefresh.
*
* You would put this in the app/plugin/PullRefresh.js file and then you can require this class and it will be loaded.
*/
Ext.define('mobuy.plugin.PullRefresh', {
extend : 'Ext.plugin.PullRefresh',
Ext.define('foo', {
....
a : {
one : function() {},
two : function() {}
},
b : {
three : function() {},
@mitchellsimoens
mitchellsimoens / gist:3418956
Created August 21, 2012 20:07
Fire after anim
new Ext.Container({
fullscreen : true,
layout : {
type : 'card',
animation : {
type : 'slide'
}
},
items : [
{
@mitchellsimoens
mitchellsimoens / gist:3658370
Created September 6, 2012 16:44
setActiveItem and string/int
var cnt = new Ext.Container({
fullscreen : true,
layout : 'card',
items : [
{
xtype : 'toolbar',
docked : 'top',
items : [
{
text : 'Test (int)',
@mitchellsimoens
mitchellsimoens / gist:3739543
Created September 17, 2012 20:20
DataView vs List with Compoennts
/**
* This must use Sencha Touch 2.1.0 beta 3
* This shows how similar using components is in DataView and List
*/
Ext.define('MyDataItem', {
extend : 'Ext.dataview.component.DataItem',
xtype : 'mydataitem',
//<debug>