<?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>Jared Harrington</title>
	<atom:link href="http://jared-harrington.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jared-harrington.com</link>
	<description>Random collection of PHP, jQuery, and MySQL</description>
	<lastBuildDate>Thu, 31 Mar 2016 20:26:28 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.41</generator>
	<item>
		<title>Magento Adminhtml &#8211; Setting a Custom massAction Index to Your Grid</title>
		<link>http://jared-harrington.com/magento-adminhtml-setting-a-custom-massaction-index-to-your-grid/</link>
		<comments>http://jared-harrington.com/magento-adminhtml-setting-a-custom-massaction-index-to-your-grid/#comments</comments>
		<pubDate>Thu, 31 Mar 2016 20:23:39 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jared-harrington.com/?p=44</guid>
		<description><![CDATA[If you ever run into a situation where you need to set a massAction column to use a value other than the grid&#8217;s index value, all it takes is two lines In your _prepareMassAction() function. // setting the mass action value to our specified column value $this-&#62;setMassactionIdFieldOnlyIndexValue&#40;true&#41;; $this-&#62;setMassactionIdField&#40;'product_id'&#41;; // column index The complete function in [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you ever run into a situation where you need to set a massAction column to use a value other than the grid&#8217;s index value, all it takes is two lines   In your <strong>_prepareMassAction()</strong> function.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// setting the mass action value to our specified column value</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMassactionIdFieldOnlyIndexValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMassactionIdField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product_id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// column index</span></pre></td></tr></table></div>

<p>The complete function in your <strong>Company_Extension_Block_Adminhtml_Custom_Grid</strong>  should look something like this</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _prepareMassaction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMassactionBlock</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFormFieldName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'products'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// checkbox field name</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// setting the mass action value to our specified column value</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMassactionIdFieldOnlyIndexValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMassactionIdField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product_id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// column index</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMassactionBlock</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addItem</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'update'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
         <span style="color: #0000ff;">'label'</span>    <span style="color: #339933;">=&gt;</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'labels'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mark in Stock'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
         <span style="color: #0000ff;">'url'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*/*/massStock'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
         <span style="color: #0000ff;">'confirm'</span>  <span style="color: #339933;">=&gt;</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'labels'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Are you sure you want to update these product(s)?'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://jared-harrington.com/magento-adminhtml-setting-a-custom-massaction-index-to-your-grid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento change order invoice status at your whim</title>
		<link>http://jared-harrington.com/magento-change-order-invoice-status-at-your-whim/</link>
		<comments>http://jared-harrington.com/magento-change-order-invoice-status-at-your-whim/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 16:35:21 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jared-harrington.com/?p=34</guid>
		<description><![CDATA[This was a huge problem for our customer service team and ultimately it&#8217;s a simple fix. Although you need to be careful depending on how your card processing is setup, etc. In Magento 1.6.2.0+ On line 34 change: &#60;?php foreach &#40;$this-&#62;getStatuses&#40;&#41; as $_code=&#62;$_label&#41;: ?&#62; To: &#60;?php foreach &#40;Mage::getSingleton&#40;'sales/order_config'&#41;-&#62;getStatuses&#40;&#41; as $_code=&#62;$_label&#41;: ?&#62; Shamelessly reposted from here [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This was a huge problem for our customer service team and ultimately it&#8217;s a simple fix. Although you need to be careful depending on how your card processing is setup, etc.</p>
<p>In Magento 1.6.2.0+<br />
On line 34 change:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatuses</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_code</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$_label</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>
To:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sales/order_config'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatuses</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_code</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$_label</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>
Shamelessly reposted from <a href="http://www.magentocommerce.com/boards/viewthread/9976/">here</a> with credit to RamRamM.</p>
]]></content:encoded>
			<wfw:commentRss>http://jared-harrington.com/magento-change-order-invoice-status-at-your-whim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Paypal Payflow Pro not being able to refund line items</title>
		<link>http://jared-harrington.com/magento-paypal-payflow-pro-not-being-able-to-refund-line-items/</link>
		<comments>http://jared-harrington.com/magento-paypal-payflow-pro-not-being-able-to-refund-line-items/#comments</comments>
		<pubDate>Fri, 19 Oct 2012 17:52:51 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Payflow Pro]]></category>
		<category><![CDATA[Paypal]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jared-harrington.com/?p=19</guid>
		<description><![CDATA[If you are using Magento 1.7 and Paypal&#8217;s Payflow Pro you might have noticed that it does not let you refund line items on orders like you can do with other processors. Each processor class in Magento has a list of variables that define what it can and can&#8217;t do. For some reason Payflow Pro [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you are using Magento 1.7 and Paypal&#8217;s Payflow Pro you might have noticed that it does not let you refund line items on orders like you can do with other processors. Each processor class in Magento has a list of variables that define what it can and can&#8217;t do. For some reason Payflow Pro does not have <code>$_canRefundInvoicePartial</code> enabled. This variable controls whether or not you can refund line items on an order. With it disabled your ability to issue refunds via a Credit Memo is severely limited. You are reduced to using convoluted math via the Adjustment field and the customer can&#8217;t see which items were refunded.</p>
<p>Fortunately the fix is fairly simple. First make sure your Payflow Pro account has reference transactions enabled. Then you&#8217;ll want to copy Payflow Pro payment class to your local directory. It is found in: <code>/app/code/core/Mage/Paypal/Model/Payflowpro.php</code></p>
<p>After line 90 add</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_canRefundInvoicePartial</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That&#8217;s it, you&#8217;re done. You can now use Credit Memos as they&#8217;re described in Magento&#8217;s own documentation. Simple select the Qty of the item to refund and click Refund.</p>
]]></content:encoded>
			<wfw:commentRss>http://jared-harrington.com/magento-paypal-payflow-pro-not-being-able-to-refund-line-items/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FancySelect jQuery pseudo select list</title>
		<link>http://jared-harrington.com/fancyselect-jquery-pseudo-select-list/</link>
		<comments>http://jared-harrington.com/fancyselect-jquery-pseudo-select-list/#comments</comments>
		<pubDate>Tue, 31 Jul 2012 23:52:36 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jared-harrington.com/?p=8</guid>
		<description><![CDATA[Styling select lists can be a pain and they never quite turn out the way you would like. I&#8217;ll go back later and make this easier to download and use. The css could probably be shortened up a bit too. &#40;function&#40; $ &#41; &#123; $.fn.fancySelect = function&#40;sel&#41; &#123; var saved_value = $&#40;'.fancyselect-selected li', this&#41;; var [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Styling select lists can be a pain and they never quite turn out the way you would like. I&#8217;ll go back later and make this easier to download and use. The css could probably be shortened up a bit too.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> $ <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>    
  $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">fancySelect</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>sel<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>         
    <span style="color: #000066; font-weight: bold;">var</span> saved_value     <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-selected li'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> list            <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-list'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> list_element    <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-list li'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> selected_element<span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-list .selected'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> obj_container   <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> name            <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> selected        <span style="color: #339933;">=</span> sel <span style="color: #339933;">?</span> sel <span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">//sets the width of the list, if the LI is biggest, use that </span>
    <span style="color: #000066; font-weight: bold;">var</span> max_width       <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>    
    <span style="color: #000066; font-weight: bold;">var</span> saved_width     <span style="color: #339933;">=</span> saved_value.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">var</span> list_width      <span style="color: #339933;">=</span> list_element.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>saved_width <span style="color: #339933;">&gt;</span> list_width<span style="color: #009900;">&#41;</span> max_width <span style="color: #339933;">=</span> saved_width<span style="color: #339933;">;</span>    
    <span style="color: #000066; font-weight: bold;">else</span> max_width <span style="color: #339933;">=</span> list_width<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// creating the menu and junk</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-selected'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>max_width<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-list'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>max_width<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-list'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    obj_container.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// simulating optgroup, if the class is group it can't be selected</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancyselect-list .group'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
&nbsp;
    <span style="color: #006600; font-style: italic;">//saves title to data and removes title attr so it doesn't show </span>
    list_element.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// clicking the saved value at the top opens the option list (html select)</span>
    saved_value.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        list.<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'fast'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     
&nbsp;
    <span style="color: #006600; font-style: italic;">// clicking a list element (html option)</span>
    list_element.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">var</span> data_text <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">var</span> data_title <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">var</span> data_out <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>data_title.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> data_out <span style="color: #339933;">=</span> data_title<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">else</span> data_out <span style="color: #339933;">=</span> data_text<span style="color: #339933;">;</span>
&nbsp;
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#form_'</span><span style="color: #339933;">+</span>name<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>data_out<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        saved_value.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data_text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        list_element.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        list.<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'fast'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">//searching through options to find selected, repeated code but whatever.</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>selected.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        list_element.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">var</span> opt_text <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">var</span> opt_title <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>            
            <span style="color: #000066; font-weight: bold;">var</span> opt_out <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>opt_title.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> opt_out <span style="color: #339933;">=</span> opt_title<span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">else</span> opt_out <span style="color: #339933;">=</span> opt_text<span style="color: #339933;">;</span>            
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>selected <span style="color: #339933;">==</span> $.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>opt_out<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#form_'</span><span style="color: #339933;">+</span>name<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>opt_out<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                saved_value.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>opt_text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                list_element.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span> jQuery <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Call with the code below.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.fancyselect-selected</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/select_bg.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.fancyselect-selected</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">25px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/select-arrow-down.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>  <span style="color: #808080; font-style: italic;">/* arrow bg */</span>
<span style="color: #6666ff;">.fancyselect-list</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>   <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.fancyselect-list</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">25px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.fancyselect-list</span> li<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e9e9e9</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.fancyselect-list</span> <span style="color: #6666ff;">.selected</span><span style="color: #00AA00;">,</span> 
<span style="color: #6666ff;">.fancyselect-list</span> <span style="color: #6666ff;">.selected</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e9e9e9</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFF</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.fancyselect-list</span> <span style="color: #6666ff;">.group</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">default</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.fancyselect-list</span> <span style="color: #6666ff;">.group</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#my-select-list</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span><span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span> box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">225px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#my-select-list</span>  a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#my-select-list</span>  a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span> 
<span style="color: #cc00cc;">#my-select-list</span>  a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> 
<span style="color: #cc00cc;">#my-select-list</span>  a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="html" style="font-family:monospace;">  &lt;div id=&quot;my-select-list&quot;&gt;    
    &lt;div&gt;
      &lt;ul&gt;
        &lt;li&gt;Choose an option&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div&gt;
        &lt;ul&gt;
          &lt;li title=&quot;&quot;&gt;Option group&lt;/li&gt;
          &lt;li&gt;Option 1&lt;/li&gt;
          &lt;li&gt;Option 2&lt;/li&gt;
          &lt;li title=&quot;definitely not 3&quot;&gt;Option 3&lt;/li&gt;
          &lt;li title=&quot;might be 4&quot;&gt;Option 4&lt;/li&gt;
          &lt;li&gt;Option 5&lt;/li&gt;
          &lt;li&gt;Option 6&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;  
  &lt;/div&gt;</pre></td></tr></table></div>

<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#my-select-list'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancySelect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #006600; font-style: italic;">// or call it out pre selecting a default value</span>
     <span style="color: #006600; font-style: italic;">//$('#my-select-list').fancySelect('Option 5');});</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://jared-harrington.com/fancyselect-jquery-pseudo-select-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
