<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ken&#039;s Sandbox &#187; Rico</title>
	<atom:link href="http://blog.rwre.com/archives/category/rico/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rwre.com</link>
	<description>Beer, Wine, Golf and code</description>
	<lastBuildDate>Sat, 06 Aug 2011 01:38:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implementing a Grid with LiveGrid Plus</title>
		<link>http://blog.rwre.com/archives/9</link>
		<comments>http://blog.rwre.com/archives/9#comments</comments>
		<pubDate>Fri, 03 Nov 2006 17:54:08 +0000</pubDate>
		<dc:creator>Ken Gregg</dc:creator>
				<category><![CDATA[Rico]]></category>

		<guid isPermaLink="false">http://kens.sandbox.rwre.com/implementing-a-grid-with-livegrib-plus/</guid>
		<description><![CDATA[<p>I have been working with some of the features of the Rico project for some time now. One of the nicest components is the Javascript data grid (LiveGrid). The thing about this grid is that it will display thousands of rows fetching small segments of the data as the user scrolls.</p>
<p>The original LiceGrid in the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with some of the features of the Rico project for some time now. One of the nicest components is the Javascript data grid (LiveGrid). The thing about this grid is that it will display thousands of rows fetching small segments of the data as the user scrolls.</p>
<p>The original LiceGrid in the Rico project has been enhanced by Mat Brown (<a title="http://dowdybrown.com" target="_blank" href="http://dowdybrown.com">http://dowdybrown.com</a>) to include resizable columns, filters, frozen columns, horizontal scrolling, just about every feature you would see in a data grid in a desktop application.</p>
<p>I keep seeing the same questions posted over and over in the Rico forums about the Rico grid. For the most part the implementation of the two grids is very similar. However the advanced features require quite a few differences in initialization parameters so the following discussion covers Mat&#8217;s LiveGrid Plus.<span id="more-9"></span></p>
<p>This discussion is meant to be a starting point. I am only going to cover the javascript it takes to initialize a grid. I&#8217;ll leave the html, and data script portions for future posts.</p>
<p>I have implemented LiveGrid Plus as a plug-in component for use in my applications. I plan on releasing my code as open source. Eventually I will document my entire grid implementation, but for now, hopefully this will answer a few immediate questions on the Rico forum.</p>
<p>Implementing the Grid. The javascript below is what I use to create a grid. This grid displays mls listing data.</p>
<div class="code">
<pre>var theGrid;
var rgparms = new Array();
rgparms.push("sessionid=12345");</pre>
<pre>function bodyOnLoad() {
var opts = {
largeBufferSize: 3,
menuEvent     : 'contextmenu',
frozenColumns : 0,
canSortDefault: false,
canHideDefault: true,
allowColResize: true,
canFilterDefault: false,
canPrint: false,
highltOnMouseOver: true,
rowHighlightColor: '#c4c4c5',
saveColumnInfo: true,
requestParameters : rgparms,
customFilter: "class=R&#038;lstatus=A&#038;area=bandon",
specFilterSort:   {type:'raw', canSort:true, canFilter:true, quotes:"'"},
specFilter:   {type:'raw', canSort:false, canFilter:true, quotes:"'"},
specSort:   {type:'raw', canSort:true, canFilter:false, quotes:"'"},
columnSpecs   : ['specSort','specFilterSort','specSort','specFilterSort',,,,,,'specSort','specFilterSort'],
prefetchBuffer: true
};
theGrid=new Rico.LiveGrid ('theGrid', 20, 1, '/grid/grid_data.php',opts);
}</pre>
</div>
<p>Here are descriptions of the parameters I use. These are passed to the grid as an options object defined here as opts. This is not a complete list of available parameters.</p>
<p><strong>largeBufferSize &#8211; integer</strong></p>
<blockquote><p>This determines how many rows are requested with each data request. The number of rows requested is calculated as largeBufferSize * number of rows. So with 20 visible rows in this grid we are requesting 60 records. The default value is 7 which I found was a bit large for good scrolling performance.</p></blockquote>
<p><strong>menuEvent &#8211; click | dblclick | context</strong></p>
<blockquote><p>This is the mouse event that will display the grid context menu. The context menu allows sorting and filtering for columns that support them.</p></blockquote>
<p><strong>frozenColumns &#8211; integer</strong></p>
<blockquote><p>The number of columns that will not scroll horizontally</p></blockquote>
<p><strong>canSortDefault &#8211; true/false</strong></p>
<blockquote><p>Indicates whether columns may be sorted by default.</p></blockquote>
<p><strong>canHideDefault</strong><strong> &#8211; true/false</strong></p>
<blockquote><p>Indicates whether columns may be hidden.</p></blockquote>
<p><strong>canFilterDefault &#8211; true/false</strong></p>
<blockquote><p>Indicates whether columns may be filtered by default.</p></blockquote>
<p><strong>allowColResize &#8211; true/false</strong></p>
<blockquote><p>Indicates whether columns may be resized.</p></blockquote>
<p><strong>canPrint &#8211; true/false</strong></p>
<blockquote><p>This is not a standard LiveGrid Plus parameter. I modified my version so be able to disable the print function on the context menu. Hopefully this enhancement will make it into the standard version of the code.</p></blockquote>
<p><strong>highlightOnMouseOver &#8211; true/false</strong></p>
<blockquote><p>Indicates whether rows should highlight as the mouse moves over them.</p></blockquote>
<p><strong> rowHighlightColor &#8211; color number</strong></p>
<blockquote><p>This is the color to use to highlight the row on a mouseover.</p></blockquote>
<p><strong>saveColumnInfo &#8211; true/false</strong></p>
<blockquote><p>Indicates whether to save changes to column widths, etc as cookies in the user&#8217;s browser.</p></blockquote>
<p><strong>requestParameters</strong></p>
<blockquote><p>This is an array of field=value strings that will be passed to the grid data program. I use it mostly for passing a sessionid (notice the rgparms.push at the start of the code).</p></blockquote>
<p><strong>customFilter &#8211; string</strong></p>
<blockquote><p>This is a query string that is added to the request to the grid data script.</p></blockquote>
<p><strong>specFilterSort, specSort and specFilter &#8211; object</strong></p>
<blockquote><p>Livegrid Plus allows you to create custom column specifications that control formatting and features available for each column.</p></blockquote>
<p><strong>columnSpecs &#8211; array</strong></p>
<blockquote><p>The column specs array contains an entry for each grid column. If a column is not given a specification, the default values for sort, filter, etc. are used.</p></blockquote>
<p><strong>prefetchBuffer &#8211; true/false</strong></p>
<blockquote><p>Indicates whether we need to fetch data on grid initialization. If you set this to true</p></blockquote>
<p>Initialize the grid:</p>
<blockquote>
<pre>theGrid=new Rico.LiveGrid ('theGrid', 20, 1, '/grid/grid_data.php',opts);</pre>
<p>The line above initializes the grid. In the body of the page I have created a table with the id of &#8216;theGrid&#8217;. The 20 is the number of visible rows in the grid (if make this -1, LiveGrid Plus will size your grid to fill available space). The 1 is a place holder for the total number of rows in the data set. LiveGrid Plus allows you to return the total number of rows in the returned xml from the data script. This is a very nice feature in that it allows user filtering of the data.</p>
<p>The /grid/grid_data.php is my data script and opts is the options object we just discussed.</p></blockquote>
<p>That&#8217;s it for this post. It has been busy the past couple of months and not looking to get better. I will try to find time to discuss how I create the live grid table and my php data script in the next couple of weeks.</p>
<p>I don&#8217;t normally leave comments open on posts due to spammers. I will leave them open here until the spam gets out of hand. Please post questions on the Rico 2.0 forum and feel free to leave any corrections, praise <img src='http://blog.rwre.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  etc. here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rwre.com/archives/9/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rounding Corners with Rico</title>
		<link>http://blog.rwre.com/archives/4</link>
		<comments>http://blog.rwre.com/archives/4#comments</comments>
		<pubDate>Sat, 15 Apr 2006 21:53:55 +0000</pubDate>
		<dc:creator>Ken Gregg</dc:creator>
				<category><![CDATA[Rico]]></category>

		<guid isPermaLink="false">http://kens.sandbox.rwre.com/archives/4</guid>
		<description><![CDATA[<p>One of the eye candy functions of the Rico library is the ability to round the corners of a div element. Though I do not actually use this in my projects, over the past few days I have responded to posts on the Rico forum asking for help with this function. Though I&#8217;m no expert, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the eye candy functions of the Rico library is the ability to round the corners of a div element. Though I do not actually use this in my projects, over the past few days I have responded to posts on the Rico forum asking for help with this function. Though I&#8217;m no expert, I have learned a little about the workings of Rico rounding and with all of the requests for any documentation, figured my comments are better than nothing. So here goes.</p>
<p><span id="more-4"></span>To round the corners of a div, use the following javascript function (you will need to include the prototype and rico libraries in your page but I&#8217;ll skip over the obvious):</p>
<blockquote><p>Rico.Corner.round(&#8216;yourDivId&#8217;[, myOptions]);</p></blockquote>
<p>You will need to include this in a script tag after the div in your page or add it to the page&#8217;s onLoad function. In the above myOptions is a Rico options object containing optional parameters to control which corners are to be rounded, forground, background and border colors etc. The options object looks like this (values are the defaults):</p>
<blockquote><p>var myOptions = {<br />
corners : &#8216;all&#8217;,<br />
color   : &#8216;fromElement&#8217;,<br />
bgColor : &#8216;fromParent&#8217;,<br />
blend   : true,<br />
border  : false,<br />
compact : false<br />
}</p></blockquote>
<p>Note: when I pass the myOptions above as the second parameter, IE complains (Firefox likes it fine). I don&#8217;t seem to have this problem when passing options in-line.<br />
<strong>corners</strong> &#8211; specifies which corners are to be rounded. The default is all. top and bottom specify only the top or bottom corners, tl, tr, bl, br specify individual corenrs to round.</p>
<p><strong>color</strong> &#8211; is the color of the div we are working on. The keyword fromElement is the default and will take the color from the element&#8217;s style.</p>
<p><strong>bgColor</strong> &#8211; is the background color to use. The keyword fromParent is the default and will take the color from the element&#8217;s parent style.</p>
<p><strong>blend</strong> &#8211; is true or false. If true Rico will attempt to smoth the rounded corners by blending colors.</p>
<p><strong>border</strong> &#8211; If you want a border on your element you should not include a border in the element&#8217;s style and instead, place a border color in the options border parameter.</p>
<p><strong>compact</strong> &#8211; true or false. True causes a small radius border, false is a larger radius border.</p>
<p><strong>Styling your Divs</strong></p>
<p>I have seen several posts where people have attempted to add size styles to their divs. Adding a width does not seem to cause a problem. However, if you try to set a height of the the div you will find your bottom corners showing at a poind just below the div&#8217;s content. The trick to forcing a size is to nest an inner div in the one you are rounding and setting the size on your inner div.</p>
<p>I have posted a very simple sample page showing a couple of rounded divs <a title="Rico.corner.round samples" href="http://kens.sandbox.rwre.com/rico/rounding.html">here</a>. Hope this helps get you started. I watch the Rico forums so please post your questions there where people a lot smarter than I have a chance to help you. However, corrections and comments are always welcome.</p>
<p>Please post any comments or questions about this post on the Rico support forum (forum.openrico.org).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rwre.com/archives/4/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

