<?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>Allan Brown &#187; prepopulate</title>
	<atom:link href="http://allanbrown.me/tag/prepopulate/feed/" rel="self" type="application/rss+xml" />
	<link>http://allanbrown.me</link>
	<description>Proramming, Magento and me</description>
	<lastBuildDate>Tue, 19 Jan 2010 21:29:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Define or pre-select products or items in a massaction Magento grid</title>
		<link>http://allanbrown.me/magento/define-or-pre-select-products-or-items-in-a-massaction-magento-grid/</link>
		<comments>http://allanbrown.me/magento/define-or-pre-select-products-or-items-in-a-massaction-magento-grid/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 21:27:46 +0000</pubDate>
		<dc:creator>Allan Brown</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[grids]]></category>
		<category><![CDATA[internal_products]]></category>
		<category><![CDATA[Mage_Adminhtml_Block_Widget_Grid]]></category>
		<category><![CDATA[Massaction]]></category>
		<category><![CDATA[massaction grid]]></category>
		<category><![CDATA[prepopulate]]></category>
		<category><![CDATA[products]]></category>
		<category><![CDATA[setParam]]></category>

		<guid isPermaLink="false">http://allanbrown.me/?p=42</guid>
		<description><![CDATA[Recently while building an administration interface for Magento (in adminhtml) I was needing to select products which should be added to a newsletter template (custom module).  The problem is that there is no obvious way to pre-select items or products when using a massaction grid in Magento.  The logic im trying to manipulate is contained in Mage_Adminhtml_Block_Widget_Grid.]]></description>
			<content:encoded><![CDATA[<p>Recently while building an administration interface for Magento (in adminhtml) I was needing to select products which should be added to a newsletter template (custom module).  The problem is that there is no obvious way to pre-select items or products when using a massaction grid in Magento.  The logic im trying to manipulate is contained in Mage_Adminhtml_Block_Widget_Grid.</p>
<p>The solution is to change (or pre-populate) the getRequest parameters (_POST values) so that the grid thinks that products have been selected on a previous page.  This can be done using the example code below, which should work for Magento massaction grids for products.</p>
<p><code>$this-&gt;getRequest()-&gt;setParam('internal_products',implode(',',$productIdArray));</code></p>
<p>$productIdArray contains a simple array of ids matching products.  Such as array(12,13,14,15)</p>
<div class="shr-publisher-42"></div>]]></content:encoded>
			<wfw:commentRss>http://allanbrown.me/magento/define-or-pre-select-products-or-items-in-a-massaction-magento-grid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
