view release on metacpan or search on metacpan
lib/Catalyst/Plugin/AutoCRUD/static/cpac.css view on Meta::CPAN
/* Override standard grid styles (add colour to vertical grid lines) */
.x-grid3-col {
border-left: 1px solid #EEEEEE;
border-right: 1px solid #D2D2D2;
}
/* Also remove padding from table data (to compensate for added grid lines) */
.x-grid3-row td, .x-grid3-summary-row td {
padding-left: 0px;
padding-right: 0px;
cursor: pointer;
}
.half-grey, .x-grid3-dirty-row td {
color: #aaaaaa !important;
cursor: auto !important;
}
.half-grey-pointer {
color: #aaaaaa !important;
}
.x-grid3-cell img {
vertical-align: middle;
}
lib/Catalyst/Plugin/AutoCRUD/templates/extjs2/javascript/grid.tt view on Meta::CPAN
,params: {
key: rec.get('cpac__id')
}
,success: function(response,options) {
grid.loadMask.el.unmask();
Ext.MessageBox.alert(
'Success'
,'Entry successfully deleted.'
,function() {
// XXX private parts of pagingtoolbar
pagebar.doLoad(pagebar.cursor);
}
);
}
,failure: function(response,options) {
grid.loadMask.el.unmask();
Ext.MessageBox.alert(
'Problem deleting entry'
,'Sorry, the entry could not be deleted. '
+ 'Is its primary key referenced in another table?'
);
lib/Catalyst/Plugin/AutoCRUD/templates/extjs2/javascript/grid.tt view on Meta::CPAN
}
[% END %]
}
,beforeedit: function(e) {
// cancel ENTER key driven edits from the filter row
// also cancel on the filter row itself if a checkbox
if ((e.row !== 0) || isCheck(e.field)) { return false }
}
,columnmove: function(oldidx, newidx) {
// XXX private parts of pagingtoolbar
pagebar.doLoad(pagebar.cursor);
}
}
,selModel: new Ext.grid.RowSelectionModel // req'd to deselect row
,tbar: toolbar
,bbar: pagebar
});
lib/Catalyst/Plugin/AutoCRUD/templates/extjs2/javascript/grid/pagebar.tt view on Meta::CPAN
Ext.ux.PagingToolbarForFilterGrid.superclass.initComponent.call(this);
}
,updateInfo : function() {
if (this.displayEl) {
var count = this.store.getCount() - 1;
var msg = count == 0 ?
this.emptyMsg :
String.format(
this.displayMsg,
this.cursor+1, this.cursor+count, this.store.getTotalCount()
);
this.displayEl.update(msg);
}
}
// make the "Page x of y" work when we choose to show all rows
,getPageData : function() {
var total = this.store.getTotalCount();
var pgsz = Ext.state.Manager.get('cpac-pgsz', pagebar.pageSize);
if (isNaN(pgsz)) { pgsz = total }
return {
total : total
,activePage : Math.ceil((this.cursor + pgsz) / pgsz)
,pages : total < pgsz ? 1 : Math.ceil(total / pgsz)
};
}
});
var pagebar = new Ext.ux.PagingToolbarForFilterGrid({
id: 'pagebar'
,pageSize: Ext.state.Manager.get('cpac-pgsz', 10)
,store: store
,displayInfo: true
lib/Catalyst/Plugin/AutoCRUD/templates/extjs2/javascript/grid/pagebar.tt view on Meta::CPAN
,maskRe: /[0-9]/
,store: [10, 20, 50, 100, 'all']
,listeners: {
render: function(combo) {
var pgsz = Ext.state.Manager.get('cpac-pgsz', pagebar.pageSize);
combo.setValue( isNaN(pgsz) ? 'all' : pgsz );
}
,select: function(combo) {
pagebar.pageSize = parseInt(combo.getRawValue(), 10);
Ext.state.Manager.set('cpac-pgsz', pagebar.pageSize);
pagebar.doLoad(pagebar.cursor);
}
,specialkey: function(combo, e) {
if (e.getKey() == 13) {
pagebar.pageSize = parseInt(combo.getRawValue(), 10) || 'all';
Ext.state.Manager.set('cpac-pgsz', pagebar.pageSize);
combo.setValue(pagebar.pageSize);
pagebar.doLoad(pagebar.cursor);
}
}
}
}
]
});
lib/Catalyst/Plugin/AutoCRUD/templates/extjs2/javascript/grid/toolbar.tt view on Meta::CPAN
// need to remove query string to reset
store.proxy.conn.url = '[% c.uri_for( c.controller('AutoCRUD::DisplayEngine::ExtJS2').action_for('list'),
[cpac.g.site,cpac_db,cpac_table] ) %]'
[% IF cpac.g.site == 'default' %]
Ext.get('cpac_browse_link').set({href: '[% c.uri_for( c.controller('AutoCRUD::Root').action_for('table'),
[cpac_db], cpac_table, 'browse' ) %]'});
[% ELSE %]
Ext.get('cpac_browse_link').set({href: '[% c.uri_for( c.controller('AutoCRUD::Root').action_for('source'),
[cpac.g.site,cpac_db], cpac_table, 'browse' ) %]'});
[% END %]
pagebar.doLoad(pagebar.cursor);
}
}
,' ' ,{
text: 'Apply Filters'
,cls: 'x-btn-text-icon'
,icon: '[% c.uri_for( c.controller('AutoCRUD::Static').action_for('cpacstatic'), "find.png" ) %]'
,handler: function (){
var params = {};
var searchrow = grid.getStore().getAt(0).data;
for (var key in searchrow) {
lib/Catalyst/Plugin/AutoCRUD/templates/extjs2/javascript/update.tt view on Meta::CPAN
if (!this.boxLabel && !this.fieldLabel) {
this.el.alignTo(this.wrap, 'c-c');
}
}
});
// called from acknowledgement dialog
var refreshandclose = function(btn,text){
if (btn == 'ok') {
// XXX using private parts of PagingToolbar
pagebar.doLoad( pagebar.cursor ); // reload
Ext.getCmp('main-win').close();
}
};
[% PROCESS extjs2/javascript/update/tabs.tt %]
[% PROCESS extjs2/javascript/update/window.tt %]