This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Diagnostics; | |
using System.Collections.ObjectModel; | |
using System.Runtime.Serialization; | |
/* | |
using My.Domain.Namespace; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Diagnostics; | |
using System.Collections.ObjectModel; | |
using System.Runtime.Serialization; | |
/* | |
using My.Domain.Namespace; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
// FizzBuzz | |
for(var i=1; i<=100; i++) { | |
var fizz = (i % 3 == 0 ? "fizz" : "") + (i % 5 == 0 ? "buzz" : ""); | |
console.log(fizz == "" ? i : fizz); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object oriented Javascript with ExtJS | |
Ext.namespace('App.stub'); | |
App.stub.MyObject = Ext.extend(Object, { | |
prop1: 'some string', | |
prop2: 100, | |
prop3: { | |
month: 10, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var data = { | |
"GetResult":[ | |
{ | |
"ID":1, | |
"width":150, | |
"height":50 | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.create('Ext.form.Panel', { | |
title: 'Simple Form with FieldSets', | |
labelWidth: 75, // label settings here cascade unless overridden | |
url: '/user/save', | |
frame: true, | |
bodyStyle: 'padding: 5px 5px 0', | |
width: 550, | |
renderTo: Ext.getBody(), | |
layout: 'column', // arrange fieldsets side by side | |
defaults: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ext Controller Button click event firing twice. | |
* | |
* In our custom routing we lookup the controller by name and fire the init() method. | |
* We found in doing so when we had components with event listeners firing twice. | |
* To get around all the duplicate events, rather than say clearing all the event | |
* listeners in init(), we moved the this.control() into the onLaunch() event. | |
* As init() is called when your application boots up, and the onLaunch() is | |
* kind of like init(), but called after the viewport is created. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Ext JS 4.0.7 Pie Chart with series event listeners. | |
* Place the listener inside the series and not the chart as you want the event on each series (slice specific data). | |
* Now, the item variable holds all of information and data. For each series, the property to get data will differ. | |
* So, you will have to inspect the item object using Firebug or Chrome developer tools. The events are; | |
* itemmouseup, itemmousedown, itemmousemove, and afterrender. | |
*/ | |
var store = Ext.create('Ext.data.JsonStore', { | |
fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.create('Ext.data.Store', { | |
storeId:'simpsonsStore', | |
fields:['username', 'name', 'email', 'phone'], | |
data:{'items':[ | |
{ 'username': 'lsimpson', 'name': 'Lisa', 'email':'lisa@simpsons.com', 'phone':'555-111-1224' }, | |
{ 'username': 'bsimpson', 'name': 'Bart', 'email':'bart@simpsons.com', 'phone':'555-222-1234' }, | |
{ 'username': 'hsimpson', 'name': 'Homer', 'email':'home@simpsons.com', 'phone':'555-222-1244' }, | |
{ 'username': 'msimpson', 'name': 'Marge', 'email':'marge@simpsons.com', 'phone':'555-222-1254' } | |
]}, | |
proxy: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prevent BACKSPACE | |
$(document).keydown(function(e) { | |
if (e.target.type !== 'textarea') { | |
var code = e.keyCode || e.which; | |
if (code === 8) { //BACKSPACE keycode | |
//e.cancelBubble is supported by IE - this will kill the bubbling process. | |
e.cancelBubble = true; | |
e.returnValue = false; |
OlderNewer