Skip to content

Instantly share code, notes, and snippets.

var Creature = (function () {
// constructor
function Creature (name) {
// public properties
this.name = name;
this.extremities;
this.isBird;
}
// private properties
var bones;
/**
*
*/
def([
], function () {
return Backbone.Model.extend({
/**
********* OBJECT PARAMETER'S VARIABLES *********
*/
appendFilenameColumn : function(anonDatasetDescriptor, id, index) {
var datasetDescriptor = anonDatasetDescriptor.copy(id);
var colArray = Ext.Array.clone(datasetDescriptor.get('columns'));
if (index != null) {
colArray = Ext.Array.insert(colArray, index, [{ name : 'filename', title : 'Filename', type : Insight.util.Util.wrapWithDataTooltip }]);
} else {
colArray = Ext.Array.merge( colArray, [{ name : 'filename', title : 'Filename', type : Insight.util.Util.wrapWithDataTooltip }] );
}
datasetDescriptor.set('columns', colArray );
@kbuzyk
kbuzyk / gist:1250487
Created September 29, 2011 10:32
how about to add condition that checks current page and total pages count?
//Insight.view.PagingGrid
storeListener : function(store) {
var toolbar = this.down('pagingtoolbar');
if ( toolbar ) {
var newVisible = (store.getTotalCount() > store.pageSize);
var oldVisible = toolbar.isVisible();
toolbar.setVisible(newVisible);
store.currentPage = (Math.ceil(store.getTotalCount()/store.pageSize) >= store.currentPage) ? store.currentPage : Math.ceil(store.getTotalCount()/store.pageSize);
if (oldVisible != newVisible) {