Skip to content

Instantly share code, notes, and snippets.

View ExtAnimal's full-sized avatar

Nige White ExtAnimal

  • Animal Software SAS
  • Lavercantière, 46340, France
View GitHub Profile
@ExtAnimal
ExtAnimal / Ext.js
Created October 7, 2011 18:27
platform/core/source/Ext.js Avoiding placing a reference to the Ext namespace as a DOM property on window
getUniqueGlobalNamespace: function() {
var uniqueGlobalNamespace = this.uniqueGlobalNamespace;
if (uniqueGlobalNamespace === undefined) {
var i = 0;
do {
uniqueGlobalNamespace = 'ExtBox' + (++i);
} while (Ext.global[uniqueGlobalNamespace] !== undefined);
@ExtAnimal
ExtAnimal / gist:1433122
Created December 5, 2011 10:17
Element.alignTo without arbitrary 5,5 addition to scrollX/Y
getAlignToXY : function(alignToEl, posSpec, offset) {
alignToEl = Ext.get(alignToEl);
if (!alignToEl || !alignToEl.dom) {
//<debug>
Ext.Error.raise({
sourceClass: 'Ext.dom.Element',
sourceMethod: 'getAlignToXY',
msg: 'Attempted to align an element that doesn\'t exist'
});
@ExtAnimal
ExtAnimal / grid-perf-test.html
Created January 18, 2012 10:06
Ext 3.x Grid performance example
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Stateful Array Grid Example</title>
<!-- ** CSS ** -->
<!-- base library -->
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<!-- ** Javascript ** -->
@ExtAnimal
ExtAnimal / 5142.js
Created January 18, 2012 10:07
4.1 Grid performance testcase
Ext.require('*');
Ext.onReady(function() {
Ext.define('Employee', {
extend: 'Ext.data.Model',
fields: [
{name: 'rating', type: 'int'},
{name: 'salary', type: 'float'},
{name: 'name'}
]
@ExtAnimal
ExtAnimal / EventManager.js
Created January 19, 2012 10:51
4.1.0 beta 3 EventManager code
/**
* @class Ext.EventManager
* Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides
* several useful events directly.
* See {@link Ext.EventObject} for more details on normalized event objects.
* @singleton
*/
Ext.EventManager = new function() {
var EventManager = this,
doc = document,
@ExtAnimal
ExtAnimal / startuptest.html
Created January 19, 2012 20:33
ExtJS load + startup test
<html>
<head>
<title>Load + Startup test</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<script type="text/javascript">
window.start = new Date().getTime();
</script>
<script type="text/javascript" src="../../ext-all.js"></script>
<script type="text/javascript">
Ext.require(['*']);
@ExtAnimal
ExtAnimal / AccordionMenu.html
Created January 20, 2012 19:59
Accordion of Menus. Drop into extjs/examples/<anywhere>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<style type="text/css">
.my-menu .x-menu-item-link {
padding-left: 4px;
}
</style>
<script type="text/javascript" src="../../ext-all.js"></script>
<script type="text/javascript">
@ExtAnimal
ExtAnimal / mats-collapsebug.js
Created January 24, 2012 01:48
Mats's collapse bug - run using extjs/test/issues/issue.html?id=mats-collapsebug
Ext.require('*');
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.getBody().update('');
// setup the state provider, all state information will be saved to a cookie
Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));
// sample static data for the store
var myData = [
@ExtAnimal
ExtAnimal / auto-height-grid.html
Created March 13, 2012 06:14
Auto height grid
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Auto heihght grid</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../shared/example.css" />
<script type="text/javascript" src="../../ext-all.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});
cluster:
name: CMTPRODLDN
network:
host: *********
node:
data: true
path: