view release on metacpan or search on metacpan
lib/CatalystX/CRUD/YUI/TT/static/css/crud/base.css view on Meta::CPAN
}
#crud-links li a {
display:block;
padding:2px 2px 2px 10px;
}
#crud-links li a:hover {
color: #222;
background: #ffdd77;
/* cursor:pointer; */
}
#crud-links li a.selected {
color: #222;
background: transparent url(http://yui.yahooapis.com/2.6.0/build/assets/skins/sam/menuitem_submenuindicator.png) no-repeat scroll right center;
background-color: #fff;
font-weight:bold;
cursor: default;
}
#crud-body {
padding: 0.5em;
margin-left: 200px;
border-top: 2px solid #7a0019;
border-left: 1px solid #aaa;
height: 100%;
}
lib/CatalystX/CRUD/YUI/TT/static/css/crud/base.css view on Meta::CPAN
}
/* button.button gets extra 1px anyway */
a.button {
padding: 3px;
}
.button:hover {
color: #111;
background-color: #ffdd77;
cursor: pointer;
border: 1px inset #7a0019;
}
#main a:hover,
a.box:hover,
.crud a:hover,
button.box:hover
{
background-color: #ffdd77;
cursor:pointer;
}
.xls_link {
margin: 8px 0;
}
span.error, div.error
{
font-size:95%;
color:red;
lib/CatalystX/CRUD/YUI/TT/static/css/crud/datatable.css view on Meta::CPAN
/* YUI datatable overrides */
/* results matrix remove 'button' */
div.yui-dt-col-_remove.yui-dt-liner
{
text-align: center;
color: #7A0019;
font-size: 90%;
cursor:pointer;
}
/* div.yui-dt-col-_remove:hover, */
div.yui-dt-col-_remove.hover
{
color: #000;
text-decoration: underline;
}
.yui-skin-sam .yui-dt-table caption {
lib/CatalystX/CRUD/YUI/TT/static/css/crud/datatable.css view on Meta::CPAN
}
.yui-skin-sam .yui-dt th div:hover
{
color: #7A0019;
background-color: #ffdd77;
}
/* datatable */
.yui-skin-sam .yui-dt-body {
cursor:pointer; /* when rows are selectable */
}
.yui-skin-sam .yui-dt-data {
}
/* fix OSX gecko bug per http://developer.yahoo.com/yui/container/ */
.yui-panel-container.hide-scrollbars #addListPanel .yui-dt-bd,
.yui-panel-container.hide-scrollbars #links_panel_container .yui-dt-bd,
.yui-panel-container.hide-scrollbars #daily_schedule_panel .yui-dt-bd
lib/CatalystX/CRUD/YUI/TT/static/css/crud/form.css view on Meta::CPAN
display:inline;
margin: 0;
padding:0;
}
/* disable buttons */
.disabled, .disabled:hover {
color: #222;
border: 1px solid #000;
background-color: #eee;
cursor: none;
}
table.crud th.crud,
table.crud td.crud
{
padding: 4px;
}
table.crud th.crud {
font-weight: bold;
lib/CatalystX/CRUD/YUI/TT/static/css/crud/livegrid.css view on Meta::CPAN
.livegrid tr,
.x-panel-body tr
{
cursor: pointer;
}
.x-grid3-row-over
{
background: #ffdd77;
background-image: none;
}
.x-panel-header {
text-align:center;
lib/CatalystX/CRUD/YUI/TT/static/css/crud/menu.css view on Meta::CPAN
/* color: #fff; */
color: #7a0019;
}
/* highlighting */
.yui-skin-sam th.yui-dt-highlighted,
.yui-skin-sam th.yui-dt-highlighted a {
/* background-color:#B2D2FF; */ /* med blue hover */
background-color: #ffdd77;
color: #7a0019;
cursor:pointer;
}
.yui-skin-sam tr.yui-dt-highlighted,
.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,
.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,
.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,
.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted {
cursor:pointer;
/* background-color:#B2D2FF; */ /* med blue hover */
background-color: #ffdd77;
color: #7a0019;
}
/* menus */
.yui-skin-sam .yuimenubarnav .yuimenuitemlabel-hassubmenu {
background: transparent url(http://yui.yahooapis.com/2.6.0/build/assets/skins/sam/menuitem_submenuindicator.png) no-repeat scroll right center;
}
.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected,
.yui-skin-sam .yuimenubarnav .yuimenuitemlabel-selected
{
color: #7a0019;
cursor:pointer;
background-color: #ffdd77;
}
.yui-skin-sam .yuimenubarnav .yuimenuitemlabel {
border-bottom: none; /* undo the global a def */
}
lib/CatalystX/CRUD/YUI/TT/static/css/crud/panel.css view on Meta::CPAN
position: absolute;
width: 10px;
height: 10px;
right: 0;
bottom: 0;
margin: 0;
padding: 0;
z-index: 1;
background: url(http://developer.yahoo.com/yui/examples/container/assets/img/corner_resize.gif) left bottom no-repeat;
cursor: se-resize;
}
#panel_msg, .message {
font-weight: bold;
color: green;
}
/* popup panels */
lib/CatalystX/CRUD/YUI/TT/static/css/crud/tabview.css view on Meta::CPAN
border:solid #7A0019;
border-width:0 1px;
color:#000;
text-decoration:none;
}
.yui-skin-sam .yui-navset .yui-nav a em,
.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em {
border:solid #7A0019;
border-width:1px 0 0;
cursor:hand;
padding:0.25em .75em;
left:0; right: 0; bottom: 0; /* protect from other orientations */
top:-1px; /* for 1px rounded corners */
position:relative;
}
.yui-skin-sam .yui-navset .yui-nav .selected a,
.yui-skin-sam .yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */
.yui-skin-sam .yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */
/* background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px; *//* selected tab background */
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/CHANGELOG view on Meta::CPAN
Version 0.3a2 (GPL)
1-November-2008
- enhancement: (Toolbar.js) config object allows now to specify either the grid
or the view the toolbar is bound to
- fixed: (Store.js) "getAt()" would return "-1" if the data at the passed index
could not be found in some cases; changed to return type "undefined"
- fixed: (GridView.js) overrode method "getCell()" to return "null" if the row
for the specified index could not be found
- fixed: firing of event "cursormove" would happen before "replaceLiveRows()"
has taken care of re-assigning the rowIndex to the rows in the view which could
lead to errors; adjusted method and made sure that "replaceLiveRows()" is called
first
- enhancement: (EditorGridPanel.js, GridPanel.js) added basic support for using
cell editors for the Livegrid (EditorGridPanel-support)
- enhancement: (ext-ux-livegrid.css, DragZone.js) minor code cleanups, changed
css class "x-dd-drop-waiting" to "ext-ux-livegrid-drop-waiting"
- enhancement: (GridView.js) added method "getRow()", removed overriden method
"onCellSelect()", "onCellDeselect()", "onRowOver()", "onRowOut()" and changed
arguments for call of methods that operate on Html-elements in the view to pass
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
'buffer' : true,
/**
* @event bufferfailure
* Fires when buffering failed.
* @param {Ext.ux.BufferedGridView} this
* @param {Ext.data.Store} store The store
* @param {Object} options The options the buffer-request was initiated with
*/
'bufferfailure' : true,
/**
* @event cursormove
* Fires when the the user scrolls through the data.
* @param {Ext.ux.BufferedGridView} this
* @param {Number} rowIndex The index of the first visible row in the
* grid absolute to it's position in the model.
* @param {Number} visibleRows The number of rows visible in the grid.
* @param {Number} totalCount
*/
'cursormove' : true
});
/**
* @cfg {Number} scrollDelay The number of microseconds a call to the
* onLiveScroll-lisener should be delayed when the scroll event fires
*/
/**
* @cfg {Number} bufferSize The number of records that will at least always
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
/**
* @cfg {Object} loadMaskConfig The config of the load mask that will be shown
* by the view if a request for new data is underway.
*/
this.loadMask = false;
Ext.apply(this, config);
this.templates = {};
/**
* The master template adds an addiiotnal scrollbar to make cursoring in the
* data possible.
*/
this.templates.master = new Ext.Template(
'<div class="x-grid3" hidefocus="true"><div class="ext-ux-livegrid-liveScroller"><div></div></div>',
'<div class="x-grid3-viewport"">',
'<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>',
'<div class="x-grid3-scroller" style="overflow-y:hidden !important;"><div class="x-grid3-body">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',
"</div>",
'<div class="x-grid3-resize-marker"> </div>',
'<div class="x-grid3-resize-proxy"> </div>',
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
/**
* Indicates wether the last row in the grid is clipped and thus not fully display.
* 1 if clipped, otherwise 0.
* @param {Number}
*/
rowClipped : 0,
/**
* This is the actual y-scroller that does control sending request to the server
* based upon the position of the scrolling cursor.
* @param {Ext.Element}
*/
liveScroller : null,
/**
* This is the panel that represents the amount of data in a given repository.
* The height gets computed via the total amount of records multiplied with
* the fixed(!) row height
* @param {native HTMLObject}
*/
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
//this.grid.selModel.clearSelections(true);
this.rowIndex = 0;
this.lastScrollPos = 0;
this.lastRowIndex = 0;
this.lastIndex = 0;
this.adjustVisibleRows();
this.adjustScrollerPos(-this.liveScroller.dom.scrollTop, true);
this.showLoadMask(false);
this.refresh(true);
//this.replaceLiveRows(0, true);
this.fireEvent('cursormove', this, 0,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
return false;
} else {
var params = {};
var sInfo = this.ds.sortInfo;
if (sInfo) {
params = {
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
if (index == Number.MIN_VALUE) {
this.rowIndex = this.rowIndex + recordLen;
this.lastRowIndex = this.rowIndex;
this.adjustBufferInset();
this.adjustScrollerPos(this.rowHeight*recordLen, true);
this.fireEvent("rowsinserted", this, index, index, recordLen);
this.processRows(0, undefined, false);
// the cursor did virtually move
this.fireEvent('cursormove', this, this.rowIndex,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
return;
}
this.adjustBufferInset();
this.fireEvent("rowsinserted", this, index, index, recordLen);
return;
}
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
else if (start >= this.rowIndex && start <= this.rowIndex+(this.visibleRows-1)) {
firstRow = index;
// compute the last row that would be affected of an insert operation
lastRow = index+(recordLen-1);
this.lastRowIndex = this.rowIndex;
this.rowIndex = (start > this.rowIndex) ? this.rowIndex : start;
this.insertRows(ds, firstRow, lastRow);
if (this.lastRowIndex != this.rowIndex) {
this.fireEvent('cursormove', this, this.rowIndex,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
}
this.adjustVisibleRows();
this.adjustBufferInset();
}
// rows get added before the first visible row, which would not affect any
// rows to be re-rendered
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
this.lastRowIndex = this.rowIndex;
this.adjustVisibleRows();
this.adjustBufferInset();
this.adjustScrollerPos(this.rowHeight*recordLen, true);
this.fireEvent("rowsinserted", this, start, end, recordLen);
this.processRows(0, undefined, true);
this.fireEvent('cursormove', this, this.rowIndex,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
}
},
// {{{ ----------------------store listeners------------------------------------
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
* Handles scrolling through the grid. Since the grid is fixed and rows get
* removed/ added subsequently, the only way to determine the actual row in
* view is to measure the <tt>scrollTop</tt> property of the <tt>liveScroller</tt>'s
* DOM element.
*
*/
onLiveScroll : function()
{
var scrollTop = this.liveScroller.dom.scrollTop;
var cursor = Math.floor((scrollTop)/this.rowHeight);
this.rowIndex = cursor;
// the lastRowIndex will be set when refreshing the view has finished
if (cursor == this.lastRowIndex) {
return;
}
this.updateLiveRows(cursor);
this.lastScrollPos = this.liveScroller.dom.scrollTop;
},
// {{{ --------------------------helpers----------------------------------------
// private
refreshRow : function(record)
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
* repaint the selections.
*/
// private
processRows : function(startRow, skipStripe, paintSelections)
{
skipStripe = skipStripe || !this.grid.stripeRows;
// we will always process all rows in the view
startRow = 0;
var rows = this.getRows();
var cls = ' x-grid3-row-alt ';
var cursor = this.rowIndex;
var index = 0;
var selections = this.grid.selModel.selections;
var ds = this.ds;
var row = null;
for(var i = startRow, len = rows.length; i < len; i++){
index = i+cursor;
row = rows[i];
// changed!
row.rowIndex = index;
if (paintSelections !== false) {
if (this.grid.selModel.isSelected(this.ds.getAt(index)) === true) {
this.addRowClass(index, "x-grid3-row-selected");
} else {
this.removeRowClass(index, "x-grid3-row-selected");
}
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
if (before) {
Ext.DomHelper.insertHtml('beforeBegin', before, html);
} else {
Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
}
// if a row is replaced, we need to set the row index for this
// row
if (isUpdate === true) {
var rows = this.getRows();
var cursor = this.rowIndex;
for (var i = 0, max_i = rows.length; i < max_i; i++) {
rows[i].rowIndex = cursor+i;
}
}
if (!isUpdate) {
this.fireEvent("rowsinserted", this, viewIndexFirst, viewIndexLast, (viewIndexLast-viewIndexFirst)+1);
this.processRows(0, undefined, true);
}
},
/**
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
var ind = this.ds.indexOf(record);
if (ind >= this.rowIndex && ind < this.rowIndex+this.visibleRows) {
return true;
}
return false;
},
/**
* Checks if the passed argument <tt>cursor</tt> lays within a renderable
* area. The area is renderable, if the sum of cursor and the visibleRows
* property does not exceed the current upper buffer limit.
*
* If this method returns <tt>true</tt>, it's basically save to re-render
* the view with <tt>cursor</tt> as the absolute position in the model
* as the first visible row.
*
* @param {Number} cursor The absolute position of the row in the data model.
*
* @return {Boolean} <tt>true</tt>, if the row can be rendered, otherwise
* <tt>false</tt>
*
*/
isInRange : function(rowIndex)
{
var lastRowIndex = Math.min(this.ds.totalLength-1,
rowIndex + (this.visibleRows-1));
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
return Math.max(0, Math.min(index, this.ds.totalLength-this.ds.bufferSize));
}
},
/**
* Updates the table view. Removes/appends rows as needed and fetches the
* cells content out of the available store. If the needed rows are not within
* the buffer, the method will advise the store to update it's contents.
*
* The method puts the requested cursor into the queue if a previously called
* buffering is in process.
*
* @param {Number} cursor The row's position, absolute to it's position in the
* data model
*
*/
updateLiveRows: function(index, forceRepaint, forceReload)
{
var inRange = this.isInRange(index);
if (this.isBuffering) {
if (this.isPrebuffering) {
if (inRange) {
this.replaceLiveRows(index);
} else {
this.showLoadMask(true);
}
}
this.fireEvent('cursormove', this, index,
Math.min(this.ds.totalLength,
this.visibleRows-this.rowClipped),
this.ds.totalLength);
this.requestQueue = index;
return;
}
var lastIndex = this.lastIndex;
this.lastIndex = index;
var inRange = this.isInRange(index);
var down = false;
if (inRange && forceReload !== true) {
// repaint the table's view
this.replaceLiveRows(index, forceRepaint);
// has to be called AFTER the rowIndex was recalculated
this.fireEvent('cursormove', this, index,
Math.min(this.ds.totalLength,
this.visibleRows-this.rowClipped),
this.ds.totalLength);
// lets decide if we can void this method or stay in here for
// requesting a buffer update
if (index > lastIndex) { // scrolling down
down = true;
var totalCount = this.ds.totalLength;
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
* prepend/ append rows after removing from either the end or the beginning
* of the table DOM to reduce expensive DOM calls.
* It will also take care of rendering the rows selected, taking the property
* <tt>bufferedSelections</tt> of the {@link BufferedRowSelectionModel} into
* account.
* Instead of calling this method directly, the <tt>updateLiveRows</tt> method
* should be called which takes care of rebuffering if needed, since this method
* will behave erroneous if data of the buffer is requested which may not be
* available.
*
* @param {Number} cursor The position of the data in the model to start
* rendering.
*
* @param {Boolean} forceReplace <tt>true</tt> for recomputing the DOM in the
* view, otherwise <tt>false</tt>.
*/
// private
replaceLiveRows : function(cursor, forceReplace, processRows)
{
var spill = cursor-this.lastRowIndex;
if (spill == 0 && forceReplace !== true) {
return;
}
// decide wether to prepend or append rows
// if spill is negative, we are scrolling up. Thus we have to prepend
// rows. If spill is positive, we have to append the buffers data.
var append = spill > 0;
// abs spill for simplyfiying append/prepend calculations
spill = Math.abs(spill);
// adjust cursor to the buffered model index
var bufferRange = this.ds.bufferRange;
var cursorBuffer = cursor-bufferRange[0];
// compute the last possible renderindex
var lpIndex = Math.min(cursorBuffer+this.visibleRows-1, bufferRange[1]-bufferRange[0]);
// we can skip checking for append or prepend if the spill is larger than
// visibleRows. We can paint the whole rows new then-
if (spill >= this.visibleRows || spill == 0) {
this.mainBody.update(this.renderRows(cursorBuffer, lpIndex));
} else {
if (append) {
this.removeRows(0, spill-1);
if (cursorBuffer+this.visibleRows-spill <= bufferRange[1]-bufferRange[0]) {
var html = this.renderRows(
cursorBuffer+this.visibleRows-spill,
lpIndex
);
Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
}
} else {
this.removeRows(this.visibleRows-spill, this.visibleRows-1);
var html = this.renderRows(cursorBuffer, cursorBuffer+spill-1);
Ext.DomHelper.insertHtml('beforeBegin', this.mainBody.dom.firstChild, html);
}
}
if (processRows !== false) {
this.processRows(0, undefined, true);
}
this.lastRowIndex = cursor;
},
/**
* Adjusts the scroller height to make sure each row in the dataset will be
* can be displayed, no matter which value the current height of the grid
* component equals to.
*/
// protected
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
}
st = view.ds;
st.un('loadexception', this.enableLoading, this);
st.un('beforeload', this.disableLoading, this);
st.un('load', this.enableLoading, this);
vw.un('rowremoved', this.onRowRemoved, this);
vw.un('rowsinserted', this.onRowsInserted, this);
vw.un('beforebuffer', this.beforeBuffer, this);
vw.un('cursormove', this.onCursorMove, this);
vw.un('buffer', this.onBuffer, this);
vw.un('bufferfailure', this.enableLoading, this);
this.view = undefined;
},
/**
* Binds the toolbar to the specified {@link Ext.ux.grid.Livegrid}
*
* @param {Ext.grird.GridView} view The view to bind
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
{
this.view = view;
var st = view.ds;
st.on('loadexception', this.enableLoading, this);
st.on('beforeload', this.disableLoading, this);
st.on('load', this.enableLoading, this);
view.on('rowremoved', this.onRowRemoved, this);
view.on('rowsinserted', this.onRowsInserted, this);
view.on('beforebuffer', this.beforeBuffer, this);
view.on('cursormove', this.onCursorMove, this);
view.on('buffer', this.onBuffer, this);
view.on('bufferfailure', this.enableLoading, this);
},
// ----------------------------------- Listeners -------------------------------
enableLoading : function()
{
this.loading.setDisabled(false);
},
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all-debug.js view on Meta::CPAN
* @class Ext.ux.grid.livegrid.EditorGridPanel
* @extends Ext.grid.EditorGridPanel
* @constructor
* @param {Object} config
*
* @author Thorsten Suckow-Homberg <ts@siteartwork.de>
*/
Ext.ux.grid.livegrid.EditorGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
/**
* Overriden so the panel listens to the "cursormove" event for
* cancelling any edit that is in progress.
*
* @private
*/
initEvents : function()
{
Ext.ux.grid.livegrid.EditorGridPanel.superclass.initEvents.call(this);
this.view.on("cursormove", this.stopEditing, this, [true]);
},
/**
* Starts editing the specified for the specified row/column
* Will be cancelled if the requested row index to edit is not
* represented by data due to out of range regarding the view's
* store buffer.
*
* @param {Number} rowIndex
* @param {Number} colIndex
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-all.js view on Meta::CPAN
Ext.namespace("Ext.ux.grid.livegrid");Ext.ux.grid.livegrid.GridPanel=Ext.extend(Ext.grid.GridPanel,{onRender:function(B,A){Ext.ux.grid.livegrid.GridPanel.superclass.onRender.call(this,B,A);var C=this.getStore();if(C._autoLoad===true){delete C._autoLo...
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/build/livegrid-core.js view on Meta::CPAN
Ext.namespace("Ext.ux.grid.livegrid");Ext.ux.grid.livegrid.GridPanel=Ext.extend(Ext.grid.GridPanel,{onRender:function(B,A){Ext.ux.grid.livegrid.GridPanel.superclass.onRender.call(this,B,A);var C=this.getStore();if(C._autoLoad===true){delete C._autoLo...
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/EditorGridPanel.js view on Meta::CPAN
* @class Ext.ux.grid.livegrid.EditorGridPanel
* @extends Ext.grid.EditorGridPanel
* @constructor
* @param {Object} config
*
* @author Thorsten Suckow-Homberg <ts@siteartwork.de>
*/
Ext.ux.grid.livegrid.EditorGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
/**
* Overriden so the panel listens to the "cursormove" event for
* cancelling any edit that is in progress.
*
* @private
*/
initEvents : function()
{
Ext.ux.grid.livegrid.EditorGridPanel.superclass.initEvents.call(this);
this.view.on("cursormove", this.stopEditing, this, [true]);
},
/**
* Starts editing the specified for the specified row/column
* Will be cancelled if the requested row index to edit is not
* represented by data due to out of range regarding the view's
* store buffer.
*
* @param {Number} rowIndex
* @param {Number} colIndex
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
'buffer' : true,
/**
* @event bufferfailure
* Fires when buffering failed.
* @param {Ext.ux.BufferedGridView} this
* @param {Ext.data.Store} store The store
* @param {Object} options The options the buffer-request was initiated with
*/
'bufferfailure' : true,
/**
* @event cursormove
* Fires when the the user scrolls through the data.
* @param {Ext.ux.BufferedGridView} this
* @param {Number} rowIndex The index of the first visible row in the
* grid absolute to it's position in the model.
* @param {Number} visibleRows The number of rows visible in the grid.
* @param {Number} totalCount
*/
'cursormove' : true
});
/**
* @cfg {Number} scrollDelay The number of microseconds a call to the
* onLiveScroll-lisener should be delayed when the scroll event fires
*/
/**
* @cfg {Number} bufferSize The number of records that will at least always
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
/**
* @cfg {Object} loadMaskConfig The config of the load mask that will be shown
* by the view if a request for new data is underway.
*/
this.loadMask = false;
Ext.apply(this, config);
this.templates = {};
/**
* The master template adds an addiiotnal scrollbar to make cursoring in the
* data possible.
*/
this.templates.master = new Ext.Template(
'<div class="x-grid3" hidefocus="true"><div class="ext-ux-livegrid-liveScroller"><div></div></div>',
'<div class="x-grid3-viewport"">',
'<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>',
'<div class="x-grid3-scroller" style="overflow-y:hidden !important;"><div class="x-grid3-body">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',
"</div>",
'<div class="x-grid3-resize-marker"> </div>',
'<div class="x-grid3-resize-proxy"> </div>',
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
/**
* Indicates wether the last row in the grid is clipped and thus not fully display.
* 1 if clipped, otherwise 0.
* @param {Number}
*/
rowClipped : 0,
/**
* This is the actual y-scroller that does control sending request to the server
* based upon the position of the scrolling cursor.
* @param {Ext.Element}
*/
liveScroller : null,
/**
* This is the panel that represents the amount of data in a given repository.
* The height gets computed via the total amount of records multiplied with
* the fixed(!) row height
* @param {native HTMLObject}
*/
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
//this.grid.selModel.clearSelections(true);
this.rowIndex = 0;
this.lastScrollPos = 0;
this.lastRowIndex = 0;
this.lastIndex = 0;
this.adjustVisibleRows();
this.adjustScrollerPos(-this.liveScroller.dom.scrollTop, true);
this.showLoadMask(false);
this.refresh(true);
//this.replaceLiveRows(0, true);
this.fireEvent('cursormove', this, 0,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
return false;
} else {
var params = {};
var sInfo = this.ds.sortInfo;
if (sInfo) {
params = {
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
if (index == Number.MIN_VALUE) {
this.rowIndex = this.rowIndex + recordLen;
this.lastRowIndex = this.rowIndex;
this.adjustBufferInset();
this.adjustScrollerPos(this.rowHeight*recordLen, true);
this.fireEvent("rowsinserted", this, index, index, recordLen);
this.processRows(0, undefined, false);
// the cursor did virtually move
this.fireEvent('cursormove', this, this.rowIndex,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
return;
}
this.adjustBufferInset();
this.fireEvent("rowsinserted", this, index, index, recordLen);
return;
}
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
else if (start >= this.rowIndex && start <= this.rowIndex+(this.visibleRows-1)) {
firstRow = index;
// compute the last row that would be affected of an insert operation
lastRow = index+(recordLen-1);
this.lastRowIndex = this.rowIndex;
this.rowIndex = (start > this.rowIndex) ? this.rowIndex : start;
this.insertRows(ds, firstRow, lastRow);
if (this.lastRowIndex != this.rowIndex) {
this.fireEvent('cursormove', this, this.rowIndex,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
}
this.adjustVisibleRows();
this.adjustBufferInset();
}
// rows get added before the first visible row, which would not affect any
// rows to be re-rendered
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
this.lastRowIndex = this.rowIndex;
this.adjustVisibleRows();
this.adjustBufferInset();
this.adjustScrollerPos(this.rowHeight*recordLen, true);
this.fireEvent("rowsinserted", this, start, end, recordLen);
this.processRows(0, undefined, true);
this.fireEvent('cursormove', this, this.rowIndex,
Math.min(this.ds.totalLength, this.visibleRows-this.rowClipped),
this.ds.totalLength);
}
},
// {{{ ----------------------store listeners------------------------------------
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
* Handles scrolling through the grid. Since the grid is fixed and rows get
* removed/ added subsequently, the only way to determine the actual row in
* view is to measure the <tt>scrollTop</tt> property of the <tt>liveScroller</tt>'s
* DOM element.
*
*/
onLiveScroll : function()
{
var scrollTop = this.liveScroller.dom.scrollTop;
var cursor = Math.floor((scrollTop)/this.rowHeight);
this.rowIndex = cursor;
// the lastRowIndex will be set when refreshing the view has finished
if (cursor == this.lastRowIndex) {
return;
}
this.updateLiveRows(cursor);
this.lastScrollPos = this.liveScroller.dom.scrollTop;
},
// {{{ --------------------------helpers----------------------------------------
// private
refreshRow : function(record)
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
* repaint the selections.
*/
// private
processRows : function(startRow, skipStripe, paintSelections)
{
skipStripe = skipStripe || !this.grid.stripeRows;
// we will always process all rows in the view
startRow = 0;
var rows = this.getRows();
var cls = ' x-grid3-row-alt ';
var cursor = this.rowIndex;
var index = 0;
var selections = this.grid.selModel.selections;
var ds = this.ds;
var row = null;
for(var i = startRow, len = rows.length; i < len; i++){
index = i+cursor;
row = rows[i];
// changed!
row.rowIndex = index;
if (paintSelections !== false) {
if (this.grid.selModel.isSelected(this.ds.getAt(index)) === true) {
this.addRowClass(index, "x-grid3-row-selected");
} else {
this.removeRowClass(index, "x-grid3-row-selected");
}
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
if (before) {
Ext.DomHelper.insertHtml('beforeBegin', before, html);
} else {
Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
}
// if a row is replaced, we need to set the row index for this
// row
if (isUpdate === true) {
var rows = this.getRows();
var cursor = this.rowIndex;
for (var i = 0, max_i = rows.length; i < max_i; i++) {
rows[i].rowIndex = cursor+i;
}
}
if (!isUpdate) {
this.fireEvent("rowsinserted", this, viewIndexFirst, viewIndexLast, (viewIndexLast-viewIndexFirst)+1);
this.processRows(0, undefined, true);
}
},
/**
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
var ind = this.ds.indexOf(record);
if (ind >= this.rowIndex && ind < this.rowIndex+this.visibleRows) {
return true;
}
return false;
},
/**
* Checks if the passed argument <tt>cursor</tt> lays within a renderable
* area. The area is renderable, if the sum of cursor and the visibleRows
* property does not exceed the current upper buffer limit.
*
* If this method returns <tt>true</tt>, it's basically save to re-render
* the view with <tt>cursor</tt> as the absolute position in the model
* as the first visible row.
*
* @param {Number} cursor The absolute position of the row in the data model.
*
* @return {Boolean} <tt>true</tt>, if the row can be rendered, otherwise
* <tt>false</tt>
*
*/
isInRange : function(rowIndex)
{
var lastRowIndex = Math.min(this.ds.totalLength-1,
rowIndex + (this.visibleRows-1));
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
return Math.max(0, Math.min(index, this.ds.totalLength-this.ds.bufferSize));
}
},
/**
* Updates the table view. Removes/appends rows as needed and fetches the
* cells content out of the available store. If the needed rows are not within
* the buffer, the method will advise the store to update it's contents.
*
* The method puts the requested cursor into the queue if a previously called
* buffering is in process.
*
* @param {Number} cursor The row's position, absolute to it's position in the
* data model
*
*/
updateLiveRows: function(index, forceRepaint, forceReload)
{
var inRange = this.isInRange(index);
if (this.isBuffering) {
if (this.isPrebuffering) {
if (inRange) {
this.replaceLiveRows(index);
} else {
this.showLoadMask(true);
}
}
this.fireEvent('cursormove', this, index,
Math.min(this.ds.totalLength,
this.visibleRows-this.rowClipped),
this.ds.totalLength);
this.requestQueue = index;
return;
}
var lastIndex = this.lastIndex;
this.lastIndex = index;
var inRange = this.isInRange(index);
var down = false;
if (inRange && forceReload !== true) {
// repaint the table's view
this.replaceLiveRows(index, forceRepaint);
// has to be called AFTER the rowIndex was recalculated
this.fireEvent('cursormove', this, index,
Math.min(this.ds.totalLength,
this.visibleRows-this.rowClipped),
this.ds.totalLength);
// lets decide if we can void this method or stay in here for
// requesting a buffer update
if (index > lastIndex) { // scrolling down
down = true;
var totalCount = this.ds.totalLength;
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/GridView.js view on Meta::CPAN
* prepend/ append rows after removing from either the end or the beginning
* of the table DOM to reduce expensive DOM calls.
* It will also take care of rendering the rows selected, taking the property
* <tt>bufferedSelections</tt> of the {@link BufferedRowSelectionModel} into
* account.
* Instead of calling this method directly, the <tt>updateLiveRows</tt> method
* should be called which takes care of rebuffering if needed, since this method
* will behave erroneous if data of the buffer is requested which may not be
* available.
*
* @param {Number} cursor The position of the data in the model to start
* rendering.
*
* @param {Boolean} forceReplace <tt>true</tt> for recomputing the DOM in the
* view, otherwise <tt>false</tt>.
*/
// private
replaceLiveRows : function(cursor, forceReplace, processRows)
{
var spill = cursor-this.lastRowIndex;
if (spill == 0 && forceReplace !== true) {
return;
}
// decide wether to prepend or append rows
// if spill is negative, we are scrolling up. Thus we have to prepend
// rows. If spill is positive, we have to append the buffers data.
var append = spill > 0;
// abs spill for simplyfiying append/prepend calculations
spill = Math.abs(spill);
// adjust cursor to the buffered model index
var bufferRange = this.ds.bufferRange;
var cursorBuffer = cursor-bufferRange[0];
// compute the last possible renderindex
var lpIndex = Math.min(cursorBuffer+this.visibleRows-1, bufferRange[1]-bufferRange[0]);
// we can skip checking for append or prepend if the spill is larger than
// visibleRows. We can paint the whole rows new then-
if (spill >= this.visibleRows || spill == 0) {
this.mainBody.update(this.renderRows(cursorBuffer, lpIndex));
} else {
if (append) {
this.removeRows(0, spill-1);
if (cursorBuffer+this.visibleRows-spill <= bufferRange[1]-bufferRange[0]) {
var html = this.renderRows(
cursorBuffer+this.visibleRows-spill,
lpIndex
);
Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
}
} else {
this.removeRows(this.visibleRows-spill, this.visibleRows-1);
var html = this.renderRows(cursorBuffer, cursorBuffer+spill-1);
Ext.DomHelper.insertHtml('beforeBegin', this.mainBody.dom.firstChild, html);
}
}
if (processRows !== false) {
this.processRows(0, undefined, true);
}
this.lastRowIndex = cursor;
},
/**
* Adjusts the scroller height to make sure each row in the dataset will be
* can be displayed, no matter which value the current height of the grid
* component equals to.
*/
// protected
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/Toolbar.js view on Meta::CPAN
}
st = view.ds;
st.un('loadexception', this.enableLoading, this);
st.un('beforeload', this.disableLoading, this);
st.un('load', this.enableLoading, this);
vw.un('rowremoved', this.onRowRemoved, this);
vw.un('rowsinserted', this.onRowsInserted, this);
vw.un('beforebuffer', this.beforeBuffer, this);
vw.un('cursormove', this.onCursorMove, this);
vw.un('buffer', this.onBuffer, this);
vw.un('bufferfailure', this.enableLoading, this);
this.view = undefined;
},
/**
* Binds the toolbar to the specified {@link Ext.ux.grid.Livegrid}
*
* @param {Ext.grird.GridView} view The view to bind
lib/CatalystX/CRUD/YUI/TT/static/js/livegrid/src/Toolbar.js view on Meta::CPAN
{
this.view = view;
var st = view.ds;
st.on('loadexception', this.enableLoading, this);
st.on('beforeload', this.disableLoading, this);
st.on('load', this.enableLoading, this);
view.on('rowremoved', this.onRowRemoved, this);
view.on('rowsinserted', this.onRowsInserted, this);
view.on('beforebuffer', this.beforeBuffer, this);
view.on('cursormove', this.onCursorMove, this);
view.on('buffer', this.onBuffer, this);
view.on('bufferfailure', this.enableLoading, this);
},
// ----------------------------------- Listeners -------------------------------
enableLoading : function()
{
this.loading.setDisabled(false);
},