PDA

View Full Version : CollapsedToolbar. Do something useful with collapsed north/south regions.



Animal
13 Mar 2008, 2:36 AM
This plugin requires Ext 2.0.2 plus the new Container based Toolbar from here: http://extjs.com/forum/showthread.php?p=122647#post122647

The plugin extends Ext.Toolbar, and renders itself into the collapsed element which is visible when a north/south border layout region collapses.

It supports all Toolbar methods. Buttons don't look so great because the element is smaller than a standard Toolbar, and buttons take up too much height, but if you need them, you have them.

It also supports addTool which takes a specification the same as the tools specification of Ext.Panel.

All items can carry an extra config align:'left' or align:'right'.

Below is an example which drops into examples/*

CSS needed is embedded in the HTML head.

This GIF is required in the directory too as search-small.gif : 5334



<html>
<head>
<title>Complex Layout</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />

<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<!-- ENDLIBS -->

<script type="text/javascript" src="../../ext-all-debug.js"></script>
<script type="text/javascript" src="create-grid.js"></script>

<!--<script language="javascript" src="../grid/PropsGrid.js"></script>-->
<style type="text/css">
html, body {
font:normal 12px verdana;
margin:0;
padding:0;
border:0 none;
overflow:hidden;
height:100%;
}
p {
margin:5px;
}
.settings {
background-image:url(../shared/icons/fam/folder_wrench.png);
}
.nav {
background-image:url(../shared/icons/fam/folder_go.png);
}
.x-log-entry { }
.x-log-entry .x-log-level {
float:left;
width:4em;
text-align:center;
margin-right: 3px
}
.x-log-entry .x-log-time {
margin-right: 3px
}
.x-log-entry .x-log-message {
margin-right: 3px
}
.x-log-debug { background-color: #46c }
.x-log-info { background-color: green }
.x-log-warning { background-color: yellow }
.x-log-error { background-color: red }

.x-tab-panel-header .x-tool {
display:none;
}

.search-small {
background: url(search-small.gif) no-repeat 0px 2px!important;
}

.x-toolbar {
overflow: hidden!important;
}

.x-toolbar-left {
float: left;
}
.x-toolbar-right {
float: right;
}

.collapse-toolbar .x-form-text {
height: 17px;
margin-top: 2px;
padding-top: 0px;
}

.collapse-toolbar .x-form-field-wrap .x-form-trigger {
top: 2px;
}

</style>
<script type="text/javascript">

Ext.ux.CollapsedToolbar = Ext.extend(Ext.Toolbar, {
constructor: function(config) {
Ext.apply(config, {
style: {
background: 'transparent',
padding: '0px',
height: '100%'
}
});
Ext.ux.CollapsedToolbar.superclass.constructor.call(this, config);
this.tools = {};
},

toolTemplate: (function() {
var tt = new Ext.Template('<div style="margin-top:3px" class="x-tool x-tool-align-{align} x-tool-{id}"> </div>');
tt.disableFormats = true;
tt.compile();
return tt;
})(),

init: function(p) {
if (p.collapsible && (p.collapseMode != 'mini') && ((p.region == 'north') || (p.region == 'south'))) {
this.client = p;
this.client.collapsedToolbar = this;
this.region = p.region;
p.on('render', this.onClientRender, this);
}
},

onClientRender: function() {
this.ct = this.client.ownerCt;
this.ct.on('afterlayout', this.doRender, this, {single:true});
},

doRender: function() {
this.parentEl = this.ct.layout[this.region].collapsedEl;

// Must be expanded. Defer render until the next layout.
if (!this.parentEl) {
this.ct.on('afterlayout', this.doRender, this, {single:true});
return;
}
var t = this.parentEl.select('div.x-tool');
t.addClass('x-tool-align-right');
t.setStyle('margin-right', '0px');
this.parentEl.addClass('x-panel-header');
this.parentEl.setStyle({
padding: '0px 3px 0px 3px'
});
this.render(this.parentEl);
this.el.addClass('collapse-toolbar');
this.el.removeClass('x-small-editor');

// If we were configure with tools, add them
if (Ext.isArray(this.tools)) {
this.addTool.apply(this, this.tools)
}

this.parentEl.on('click', function(e) {
e.stopEvent();
});
this.el.on('click', function(e) {
if (e.within(this.layout.leftTr) || e.within(this.layout.rightTr)) {
e.stopEvent();
}
}, this);
},

addTool: function(){
for(var i = 0, a = arguments, len = a.length; i < len; i++) {
var t, tc = a[i], overCls = 'x-tool-'+tc.id+'-over';
if (!tc.align) tc.align = 'right';
var alignLeft = (tc.align == 'left');
var pos = tc.position;
if (typeof pos == 'number') {
var t = this.parentEl.query('div.x-tool-align-' + tc.align);
if (!alignLeft) t.reverse();
pos = t[pos];
}
if (pos) {
t = this.toolTemplate[alignLeft ? 'insertBefore' : 'insertAfter'](pos, tc, true);
} else {
t = this.toolTemplate.insertBefore(this.parentEl.child('div.x-tool-align-right') || this.el, tc, true);
}
this.tools[tc.id] = t;
t.enableDisplayMode('block');
t.on('click', Ext.Panel.prototype.createToolHandler.call(this, t, tc, overCls, this.client));
if(tc.on){
t.on(tc.on);
}
if(tc.hidden){
t.hide();
}
if(tc.qtip){
if(typeof tc.qtip == 'object'){
Ext.QuickTips.register(Ext.apply({
target: t.id
}, tc.qtip));
} else {
t.dom.qtip = tc.qtip;
}
}
t.addClassOnOver(overCls);
}
}
});

Ext.ux.Logger = function() {
var tpl = new Ext.Template("<div class='x-log-entry'><div class='x-log-level x-log-{0:lowercase}'>" +
"{0:capitalize}</div><span class='x-log-time'>{2:date('H:i:s.u')}</span>" +
"<span class='x-log-message'>{1}</span></div>");

return Ext.apply(new Ext.Window({
title: 'Ext Logger',
closeAction: 'hide',
height: 200,
minHeight: 200,
width: 400,
autoScroll: true,
buttons: [{
text: 'Clear',
handler: function() {
Ext.ux.Logger.body.update('');
}
}]
}), {
fn: Ext.Template.prototype.insertFirst,

toggleDirection: function() {
if (this.fn === Ext.Template.prototype.insertFirst) {
this.fn = Ext.Template.prototype.append;
} else {
this.fn = Ext.Template.prototype.insertFirst;
}
},

debug: function(msg) {
this.fn.call(tpl, this.body, ['debug', msg, new Date()], true).scrollIntoView(this.body);
},

info: function(msg) {
this.fn.call(tpl, this.body, ['info', msg, new Date()], true).scrollIntoView(this.body);
},

warning: function(msg) {
this.fn.call(tpl, this.body, ['warning', msg, new Date()], true).scrollIntoView(this.body);
},

error: function(msg) {
this.fn.call(tpl, this.body, ['error', msg, new Date()], true).scrollIntoView(this.body);
}
});
}();

Ext.onReady(function(){

vselect = Ext.DomHelper.append(document.body, {
tag: 'select', cls: 'x-grid-editor x-hide-display', children: [
{tag: 'option', value: 'true', html: 'True'},
{tag: 'option', value: 'false', html: 'False'}
]
});

vfield = new Ext.form.Field({
el: vselect,
vselect : vselect,
autoShow: true,
getValue : function(){
return vselect.options[vselect.selectedIndex].text;

}
});

Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init();

var viewport = new Ext.Viewport({
layout:'border',
items:[
new Ext.BoxComponent({ // raw
region:'north',
el: 'north',
height:32
}),{
region:'south',
contentEl: 'south',
split:true,
height: 100,
minSize: 100,
maxSize: 200,
collapsible: true,
title:'South',
margins:'0 0 0 0',
plugins: [ new Ext.ux.CollapsedToolbar({
items: ['Search term: ', new Ext.form.TriggerField({
triggerClass: 'search-small',
onTriggerClick: function() {
alert('Search for "' + this.getValue() + '"');
}
})]
})]
}, new Ext.TabPanel({
region:'east',
title: 'East Side',
collapsible: true,
collapseMode: 'mini',
split:true,
width: 225,
minSize: 175,
maxSize: 400,
margins:'0 5 0 0',
activeTab:1,
items:[{
html:'<p>A TabPanel component can be a region.</p>',
title: 'A Tab',
autoScroll:true
},
new Ext.grid.PropertyGrid({
title: 'Property Grid',
closable: true,
customEditors: {
'autoFitColumns': new Ext.grid.GridEditor(vfield)
},
source: {
"(name)": "Properties Grid",
"grouping": false,
"autoFitColumns": true,
"productionQuality": false,
"created": new Date(Date.parse('10/15/2006')),
"tested": false,
"version": .01,
"borderWidth": 1
}
})]
}),{
region:'west',
id:'west-panel',
title:'West',
split:true,
width: 200,
minSize: 175,
maxSize: 400,
collapsible: true,
margins:'0 0 0 5',
layout:'accordion',
layoutConfig:{
animate:true
},
items: [{
contentEl: 'west',
title:'Navigation',
border:false,
iconCls:'nav'
},{
title:'Settings',
html:'<p>Some settings in here.</p>',
border:false,
iconCls:'settings'
}, createGrid()]
},
new Ext.TabPanel({
region:'center',
deferredRender:false,
activeTab:0,
items:[{
id: 'center3',
title: 'BUG!',
xtype: 'form',
items: {
hideLabel: true,
xtype: 'htmleditor',
id: 'problem',
anchor: '98% 98%',
value: ''
}
},{
contentEl:'center1',
title: 'Close Me',
closable:true,
autoScroll:true
},{
contentEl:'center2',
title: 'Center Panel',
autoScroll:true
}]
})
]
});
Ext.get("hideit").on('click', function() {
var w = Ext.getCmp('west-panel');
w.collapsed ? w.expand() : w.collapse();
});
});
</script>
</head>
<body>
<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
<div id="west">
<p>Hi. I'm the west panel.</p>
</div>
<div id="north">
<p>north - generally for menus, toolbars and/or advertisements</p>
</div>
<div id="center2">
<a id="hideit" href="#">Toggle the west region</a>
<p>
My closable attribute is set to false so you can't close me. The other center panels can be closed.</p>
<p>The center panel automatically grows to fit the remaining space in the container that isn't taken up by the border regions.</p>
<hr>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>
<p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>
<p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>
<p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>
<p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>
<p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>
<p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>
<p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>
</div>
<div id="center1">
<p><b>Done reading me? Close me by clicking the X in the top right corner.</b></p>
<p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>
<p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>
<p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>
<p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>
</div>
<div id="props-panel" style="width:200px;height:200px;overflow:hidden;">
</div>
<div id="south">
<p>south - generally for informational stuff, also could be for status bar</p>
</div>

</body>
</html>

krycek
13 Mar 2008, 4:06 AM
<script type="text/javascript" src="create-grid.js"></script>


do i need to copy this file from somewhere else?

Animal
13 Mar 2008, 4:52 AM
Oops:



function createGrid (){
var myData = [
['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am'],
['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],
['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],
['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],
['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
['Honeywell Intl Inc',38.77,0.05,0.13,'9/1 12:00am'],
['Intel Corporation',19.88,0.31,1.58,'9/1 12:00am'],
['International Business Machines',81.41,0.44,0.54,'9/1 12:00am'],
['Johnson & Johnson',64.72,0.06,0.09,'9/1 12:00am'],
['JP Morgan & Chase & Co',45.73,0.07,0.15,'9/1 12:00am'],
['McDonald\'s Corporation',36.76,0.86,2.40,'9/1 12:00am'],
['Merck & Co., Inc.',40.96,0.41,1.01,'9/1 12:00am'],
['Microsoft Corporation',25.84,0.14,0.54,'9/1 12:00am'],
['Pfizer Inc',27.96,0.4,1.45,'9/1 12:00am'],
['The Coca-Cola Company',45.07,0.26,0.58,'9/1 12:00am'],
['The Home Depot, Inc.',34.64,0.35,1.02,'9/1 12:00am'],
['The Procter & Gamble Company',61.91,0.01,0.02,'9/1 12:00am'],
['United Technologies Corporation',63.26,0.55,0.88,'9/1 12:00am'],
['Verizon Communications',35.57,0.39,1.11,'9/1 12:00am'],
['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
];

// example of custom renderer function
function change(val){
if(val > 0){
return '<span style="color:green;">' + val + '</span>';
}else if(val < 0){
return '<span style="color:red;">' + val + '</span>';
}
return val;
}

// example of custom renderer function
function pctChange(val){
if(val > 0){
return '<span style="color:green;">' + val + '%</span>';
}else if(val < 0){
return '<span style="color:red;">' + val + '%</span>';
}
return val;
}

// create the data store
var store = new Ext.data.SimpleStore({
fields: [
{name: 'company'},
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
]
});
store.loadData(myData);

// create the Grid
var grid = new Ext.grid.GridPanel({
id: 'grid',
store: store,
columns: [
{id:'company',header: "Company", width: 160, sortable: true, dataIndex: 'company'},
{header: "Price", width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'},
{header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
{header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
{header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
stripeRows: true,
autoExpandColumn: 'company',
autoFill: true,
title:'Array Grid',
header: true,
bbar: new Ext.PagingToolbar({
buttons: [{
text: "Click Me"
}],
store: store,
pageSize: 25
})
});

grid.on('render', function(g) {
g.getSelectionModel().selectFirstRow();
});
return grid;
};


But it's not really necessary, just part of the background clutter of the demo.

jerrybrown5
15 Mar 2008, 11:57 PM
Animal,
Another nice add on. Have you ever thought of having a separate web site (or your own pages on the extjs domain) to put all of your add ons in one place? Personally, I know that I would like to go to one place to get all of your updates.

I've attached a zip file with the dependencies together, just unzip it in the extjs/examples folder. If you add it on one of your posts I'll delete the zip attachment here.

Best regards,
Jerry Brown

NotChris
16 Mar 2008, 9:49 AM
Thank you so much for this. It was exactly what we needed.