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
var combo = new Ext.form.ComboBox({ | |
xtype: 'combo', | |
name : 'perpage', | |
width: 40, | |
listWidth: 40, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data : [ | |
['15'], | |
['25'], |
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
/** | |
* Copyright 2020 Ed Spencer | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, | |
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
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
/** | |
* @class ExtMVC.view.scaffold.Index | |
* Adds a print button to each grid (remove by setting the hasPrintButton config to false) | |
* | |
* This is an example in support of http://edspencer.net/2009/07/extoverride-monkey-patching-ext-js.html | |
*/ | |
(function() { | |
var originalBuildTopToolbar = ExtMVC.view.scaffold.Index.prototype.buildTopToolbar; | |
Ext.override(ExtMVC.view.scaffold.Index, { |
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
filterPanelConfig: { | |
filters: [ | |
{ | |
title: 'Tags', | |
iconCls: 'tag', | |
store: this.albumStore, | |
convert: function(item) { | |
return item.get('tag_list').split(','); | |
} | |
}, |
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 englishTranslations = (function() { | |
var translations = {}; | |
Ext.apply(translations, | |
//duplicates | |
{ | |
something: this.kohive | |
}, | |
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
//constructor for the MyClass class | |
MyClass = function() { | |
//do whatever constructor logic you need, or just leave it blank | |
}; | |
//creates a class-level function, which you can call via MyClass.loadThing() | |
MyClass.loadThing = function() { | |
//do your loading thing | |
} |
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
/** | |
* @class CampaignFilter | |
* @extends Ext.Panel | |
* Description | |
*/ | |
CampaignFilter = Ext.extend(Ext.Panel, { | |
constructor: function(config) { | |
var config = config || {}; |
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.onReady(function() { | |
//The panel we'll be adding our nav items to | |
var navGroup = new Ext.Panel({ | |
region: 'west', | |
width: 180 | |
}); | |
//assuming this returns some JSON like {response: [{title: 'My Nav Item', html: 'some text'}, {title: 'Another item', html: 'test'}]} | |
var store = new Ext.data.JsonStore({ | |
url: '<?= RELATIVE_PATH ?>/Nav/View', |
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
propertiesExist = function(object, properties) { | |
var allExist = true; | |
properties = properties || {}; | |
Ext.each(properties, function(property) { | |
var splits = property.split('.'); | |
var currentObj = object; | |
Ext.each(splits, function(currentProperty, index, all) { | |
if (!allExist) return false; |
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
//taken from a recent project - tells ExtMVC.Model to use a ScriptTagProxy and a remote host | |
Ext.apply(ExtMVC.Model.Adapter.REST.classMethods, { | |
urlExtension: '.json', | |
// port: 3000, | |
// host: 'http://localhost', | |
host: 'http://widgets.jungle-media.com', | |
proxyType: Ext.data.ScriptTagProxy, | |
parseSingleLoadResponse: function(response, options, callbacks) { | |
var m = this.getReader().readRecords(eval("(" + response.responseText + ")")); |