<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: custom function to fire on multiple selected rows</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-function-to-fire-on-multiple-selected-rows</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/custom-function-to-fire-on-multiple-selected-rows/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>pillarofautumn on custom function to fire on multiple selected rows</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-function-to-fire-on-multiple-selected-rows#p18533</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-function-to-fire-on-multiple-selected-rows#p18533</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>is there any way to attach and fire a custom function on multiple records like delGridRow. Basically I want to activate or de-activate a set of selected users. SO right now ,i can get the list of selected row id&#39;s and am passing them to a customised delGridRow(which is not right). So what I have now is :</p>
<p>function funcDelUsers()</p>
<p>function funcActivateUsers()</p>
<p>function funcDectivateUsers()</p>
</p>
<p>and all of then are using the following piece of code with different values for caption,msg,bSubmit, url</p>
<p>var gr = jQuery("#usersList").jqGrid(&#39;getGridParam&#39;,&#39;selarrrow&#39;);</p>
<p>if( gr.length &#62; 0 ) {</p>
<p>&#160;&#160;jQuery("#usersList").jqGrid(&#39;delGridRow&#39;,gr,{</p>
<p>&#160;&#160;reloadAfterSubmit: true,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; caption: &#39;Activate users?&#39;, &#160; &#160; &#160;//note &#8211; caption is not changing according to task</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; mtype: &#39;post&#39;,</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;msg: &#39;Do you want to activate the selected users?&#39;, &#160;// msg is not changing according to function, is fixed to the value set&#160;&#160;in the function which is activated first</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; url: is different in different functions</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
</p>
<p>So,instead of trying my way around delGridRow and try to customize it forother tasks , there should be basically two ways to&#160;</p>
<p>proceed and do the task cleanly.</p>
<p>1. attach a custom function to the jqgrid and cal it on the selected rows(do it the jqgrid way)</p>
<p>&#160;&#160; &#160; &#160; jQuery("#usersList").jqGrid(&#39;my_custom_function&#39;,gr,options};</p>
<p>&#160;&#160; &#160; &#160;my_custom_function perhaps does nothing,but it lets me access the jqgrid options,methods,events&#160;</p>
<p>&#160;&#160; &#160; &#160;Basically i should ave access to jqgrid options,methods,events &#160;inside the function and let jqgrid do the work with those options</p>
</p>
<p>2. get the row id,s &#160;by jQuery("#usersList").jqGrid(&#39;getGridParam&#39;,&#39;selarrrow&#39;) , write your own custom ajax code &#160;for activating/ deactivating &#160; &#160; the users by passing the id&#39;s to the server. reload the grid once we get response from the server.</p>
<p>I was wondering if there is any way to do it via way 1. It would be wonderful if you have any ideas to help me out.</p>
<p>Thank you.</p>
]]></description>
        	        	<pubDate>Mon, 12 Jul 2010 10:09:32 +0300</pubDate>
        </item>
</channel>
</rss>