<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7678508354561484071</id><updated>2024-09-11T16:21:41.599-07:00</updated><category term="jQuery"/><category term="jqGrid"/><category term="JavaScript"/><category term="DHTML"/><category term="MVC"/><category term="Ajax"/><category term="ASP.NET"/><category term="CSS"/><category term="1.4.2"/><category term="64-bit"/><category term="ASP.Net Mvc"/><category term="attr"/><category term="dynamic"/><category term="edittype: &quot;select&quot;"/><category term="removeAttr"/><category term="1.4.4"/><category term="32-bit"/><category term="BDD"/><category term="CPU"/><category term="CRUD"/><category term="Cichlids"/><category term="Console"/><category term="DOM"/><category term="Firebug"/><category term="Firebug Network Monitoring"/><category term="Firefox"/><category term="Google Chrome"/><category term="HTML"/><category term="IE8"/><category term="JsonRequestBehavior"/><category term="Malware"/><category term="OutputCache"/><category term="OutputCacheAttribute"/><category term="PC Protection"/><category term="Red_Light-Green-Light"/><category term="SQL"/><category term="SSRS"/><category term="Spyware"/><category term="System.Web.Mvc.OutputCacheAttribute"/><category term="TDD"/><category term="Unit testing"/><category term="Visual Studio 2008"/><category term="Windows 7"/><category term="Wndows"/><category term="cellEdit"/><category term="checkbox"/><category term="combine"/><category term="compression"/><category term="console.count"/><category term="console.debug"/><category term="console.error"/><category term="console.info"/><category term="console.log"/><category term="console.profile"/><category term="console.time"/><category term="console.timeEnd"/><category term="console.warn"/><category term="data"/><category term="database"/><category term="file"/><category term="formedit"/><category term="httpRuntime"/><category term="image"/><category term="jqQuery"/><category term="js"/><category term="jscompress"/><category term="kill"/><category term="link"/><category term="login"/><category term="machine.config"/><category term="menu"/><category term="minification"/><category term="multi-select"/><category term="onSelectRow"/><category term="path"/><category term="regedit"/><category term="restore"/><category term="select"/><category term="selectindex"/><category term="setrow"/><category term="sp_why2"/><category term="sql server"/><category term="stylelsheet"/><category term="transaction"/><category term="upgrade"/><category term="upload"/><category term="web.config"/><category term="widget"/><category term="x8086"/><title type='text'>Software Development Practices</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-697557686316039596</id><published>2011-02-25T05:46:00.001-08:00</published><updated>2011-02-25T05:46:49.464-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jqGrid"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="multi-select"/><category scheme="http://www.blogger.com/atom/ns#" term="onSelectRow"/><category scheme="http://www.blogger.com/atom/ns#" term="setrow"/><title type='text'>jqGrid - customizing the multi-select option (restrict single selection and adding custom events)</title><content type='html'>&lt;h1&gt;Goal:&lt;/h1&gt;Using the jgGrid to enable a selection of a checkbox for row selection - which is easy to set in the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;  - but also only allowing a single row to be selectable at a time while  adding events based on whether the row was selected or de-selected.&lt;br /&gt;
&lt;h1&gt;Environment:&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;&lt;a _fcksavedurl=&quot;http://jquery.com/&quot; href=&quot;http://jquery.com/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Home Page&quot;&gt;jQuery&lt;/a&gt; 1.4.4&lt;/li&gt;
&lt;li&gt;&lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt; 3.4.4a&lt;/li&gt;
&lt;/ul&gt;&lt;h1&gt;Issue:&lt;/h1&gt;The &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;  does not support the option to restrict the multi-select to only allow  for a single selection. You may ask, why bother with the multi-select  checkbox function if you only want to allow for the selection of a  single row? Good question, as an example, you want to reserve the  selection of a row to trigger another kind of event and use the checkbox  multi-select to handle a different kind of event; in other words, when I  select the row I want something entirely different to happen than when I  select to check off the checkbox for that row. &lt;br /&gt;
Also the setSelection method of the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;  is a toggle and has no support for determining whether the checkbox has  already been selected or not, So it will simply act as a switch - which  it is designed to do - but with no way out of the box to only check off  the box (as in not to de-select) rather than act like a switch. &lt;br /&gt;
Furthermore, &lt;span style=&quot;color: red;&quot;&gt;the  getGridParam(&#39;selrow&#39;) does not indicate if the row was selected or  de-selected, which seems a bit strange and is the main reason for this  blog post.&lt;/span&gt;&lt;br /&gt;
&lt;h1&gt;Solution:&lt;/h1&gt;&lt;h2&gt;How this will act:&lt;/h2&gt;When you check off a multi-select checkbox in the gird, and then  commence to select another row by checking off that row&#39;s multi-select  checkbox - I&#39;m not talking there about clicking on the row but using the  grid&#39;s multi-select checkbox - it will de-select the previous selection  so that you are always left with only a single selection.&lt;br /&gt;
Furthermore, once you select or de-select a multi-select checkbox,  fire off an event that will be determined by whether or not the row was  selected or de-selected, not just merely clicked on. So if I de-select  the row do one thing but when selecting it do another.&lt;br /&gt;
&lt;h2&gt;Implementation (this of course is only a partial code snippet):&lt;/h2&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; multiselect: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; multiboxonly: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onSelectRow: function (rowId) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var gridSelRow = $(item).getGridParam(&#39;selrow&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var s;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s = $(item).getGridParam(&#39;selarrrow&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!s || !s[0]) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(item).resetSelection();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&#39;#productLineDetails&#39;).fadeOut();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastsel = null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var selected = $.inArray(rowId, s) != -1;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (selected) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&#39;#productLineDetails&#39;).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&#39;#productLineDetails&#39;).fadeOut();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rowId &amp;amp;&amp;amp; rowId !== lastsel &amp;amp;&amp;amp; selected) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(item).GridToForm(gridSelRow, &#39;#productLineDetails&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;if (lastsel) $(item).setSelection(lastsel, false);&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;lastsel = rowId;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;h3&gt;In the example code above:&lt;/h3&gt;The &quot;item&quot; property is the id of the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;.&lt;br /&gt;
The following to settings ensure that the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;  will add the new column to select rows with a checkbox and also the not  allow for the selection by clicking on the row but to force the user to  have to click on the multi-select checkbox to select the row:&lt;br /&gt;
&lt;code&gt;multiselect: true,&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;multiboxonly: true,&lt;/code&gt;&lt;br /&gt;
Unfortunately the  var gridSelRow = $(item).getGridParam(&#39;selrow&#39;)  function will only return the row the user clicked on or rather that the  row&#39;s checkbox was clicked on and NOT whether or not it was selected  nor de-selected, but it retrieves the row id, which is what we will  need.&lt;br /&gt;
The following piece get&#39;s all rows that have been selected so far, as in have a checked off multi-select checkbox:&lt;br /&gt;
&lt;code&gt;var s;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;s = $(item).getGridParam(&#39;selarrrow&#39;);&lt;/code&gt;&lt;br /&gt;
Now determine if the checkbox the user just clicked on was selected or de-selected:&lt;br /&gt;
&lt;code&gt;var selected = $.inArray(rowId, s) != -1;&lt;/code&gt;&lt;br /&gt;
If it was selected then show a container &quot;#productLineDetails&quot;, if not hide that container away.&lt;br /&gt;
The following instruction populates a form with the grid data using  the built-in GridToForm method (just mentioned here as an example)  ONLY&amp;nbsp;if the row has been selected and NOT de-selected but more  importantly to de-select any other multi-select checkbox that may have  been selected:&lt;br /&gt;
&lt;code&gt;if (rowId &amp;amp;&amp;amp; rowId !== lastsel &amp;amp;&amp;amp; selected) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(item).GridToForm(gridSelRow, &#39;#productLineDetails&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lastsel) $(item).setSelection(lastsel, false);&lt;br /&gt;
}&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/697557686316039596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2011/02/jqgrid-customizing-multi-select-option.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/697557686316039596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/697557686316039596'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2011/02/jqgrid-customizing-multi-select-option.html' title='jqGrid - customizing the multi-select option (restrict single selection and adding custom events)'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-8074338644606530722</id><published>2011-02-17T06:45:00.000-08:00</published><updated>2011-02-17T06:45:47.539-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="menu"/><category scheme="http://www.blogger.com/atom/ns#" term="widget"/><title type='text'>Menu widget - no jQuery nor Javascript required - pure CSS</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;Goal:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Create a menu widget that does not require any javascript, extremely lightweight, very fast, soley based on CSS, compatible with FireFox and Chrome.&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Issues:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
May have some rendering issues in some versions of IE, sorry :-)&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instruments:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
* css file&lt;br /&gt;
* html with specific menu format&lt;br /&gt;
* jQuery-ui library - optional if you want to use your own images/colors&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Implementation Details:&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;HTML:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;header&quot;&gt;&lt;br /&gt;
&lt;div id=&quot;header_Menubar&quot;&gt;&lt;br /&gt;
&lt;ul class=&quot;linkList0 ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;&gt;&lt;li class=&quot;first more ui-state-default ui-corner-top ui-tabs-selected&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Home&quot; title=&quot;Home&quot;&gt;Home&lt;/a&gt;&lt;br /&gt;
&lt;ul class=&quot;linkList01 ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;&gt;&lt;li class=&quot;ifirst ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Go Home&quot;&gt;&lt;/abbr&gt;&lt;a href=&quot;http://www.blogger.com/Home&quot; title=&quot;Home&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li class=&quot;more ui-state-default ui-corner-top ui-tabs-selected&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Menu2a&quot; title=&quot;Menu 2&quot;&gt;Menu 2&lt;/a&gt;&lt;br /&gt;
&lt;ul class=&quot;linkList01 ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;&gt;&lt;li class=&quot;ifirst ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Menu 2 a&quot;&gt;&lt;/abbr&gt;&lt;a href=&quot;http://www.blogger.com/Menu2a&quot; title=&quot;Menu 2 a&quot;&gt;Menu 2 a&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;ilast ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Menu 2 b&quot;&gt;&lt;/abbr&gt;&lt;a href=&quot;http://www.blogger.com/Menu2b&quot; title=&quot;Menu 2 b&quot;&gt;Menu 2 b&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li class=&quot;more red ui-state-default ui-corner-top ui-tabs-selected&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Menu3%20d&quot; title=&quot;Menu 3&quot;&gt;Menu 3&lt;/a&gt;&lt;br /&gt;
&lt;ul class=&quot;linkList01 ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;&gt;&lt;li class=&quot;ifirst ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Menu 3 a&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Menu3a&quot; title=&quot;Menu 3 a&quot;&gt;Menu 3 a&lt;/a&gt;&lt;/abbr&gt;&lt;/li&gt;
&lt;li class=&quot;ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Menu 3 b&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Menu3b&quot; title=&quot;Menu 3 b&quot;&gt;Menu 3 b&lt;/a&gt;&lt;/abbr&gt;&lt;/li&gt;
&lt;li class=&quot;ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Menu 3 c&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Menu3c&quot; title=&quot;Menu 3 c&quot;&gt;Menu 3 c&lt;/a&gt;&lt;/abbr&gt;&lt;/li&gt;
&lt;li class=&quot;ilast ui-state-default ui-corner-top&quot;&gt;&lt;abbr title=&quot;Menu 3 d&quot;&gt;&lt;a href=&quot;http://www.blogger.com/Menu3d&quot; title=&quot;Menu 3 d&quot;&gt;Menu 3 d&lt;/a&gt;&lt;/abbr&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;CSS:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
/*    =Menu&lt;br /&gt;
-----------------------------------------------------------------------------------------    */&lt;br /&gt;
#header #header_Menubar&lt;br /&gt;
{&lt;br /&gt;
margin: 0;&lt;br /&gt;
padding: 0;&lt;br /&gt;
border: 0;&lt;br /&gt;
width: 100%;&lt;br /&gt;
height: 22px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header&lt;br /&gt;
{&lt;br /&gt;
background-color: #99cccc;&lt;br /&gt;
background-color: #aaccee;&lt;br /&gt;
background-color: #5BA3E0;&lt;br /&gt;
background-color: #006cb1;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Set menu bar background color     */&lt;br /&gt;
#header #header_Menubar&lt;br /&gt;
{&lt;br /&gt;
background-attachment: scroll;&lt;br /&gt;
background-position: left center;&lt;br /&gt;
background-repeat: repeat-x;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set main (horizontal) menu typology    */&lt;br /&gt;
#header .linkList0&lt;br /&gt;
{&lt;br /&gt;
padding: 0 0 1em 0;&lt;br /&gt;
margin-bottom: 1em;&lt;br /&gt;
font-family: &#39;Trebuchet MS&#39;, &#39;Lucida Grande&#39;,&lt;br /&gt;
Verdana, Lucida, Geneva, Helvetica,&lt;br /&gt;
Arial, sans-serif;&lt;br /&gt;
font-weight: bold;&lt;br /&gt;
font-size: 1.085em;&lt;br /&gt;
font-size: 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set all ul properties    */&lt;br /&gt;
#header .linkList0, #header .linkList0 ul&lt;br /&gt;
{&lt;br /&gt;
list-style: none;&lt;br /&gt;
margin: 0;&lt;br /&gt;
padding: 0;&lt;br /&gt;
list-style-position: outside;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set all li properties    */&lt;br /&gt;
#header .linkList0 &amp;gt; li&lt;br /&gt;
{&lt;br /&gt;
float: left;&lt;br /&gt;
position: relative;&lt;br /&gt;
font-size: 90%;&lt;br /&gt;
margin: 0 0 -1px;&lt;br /&gt;
width: 9.7em;&lt;br /&gt;
padding-right: 2em;&lt;br /&gt;
z-index: 100;    /*IE7:    Fix for IE7 hiding drop down list behind some other page elements    */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set all li properties    */&lt;br /&gt;
#header .linkList01 &amp;gt; li&lt;br /&gt;
{&lt;br /&gt;
width: 190px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 .linkList01 li&lt;br /&gt;
{&lt;br /&gt;
margin-left: 0px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set all list background image properties    */&lt;br /&gt;
/*#header .linkList0 li a&lt;br /&gt;
{&lt;br /&gt;
background-position: left center;&lt;br /&gt;
background-image: url(  &#39;../Content/Images/VerticalButtonBarGradientFade.png&#39; );&lt;br /&gt;
background-repeat: repeat-x;&lt;br /&gt;
background-attachment: scroll;&lt;br /&gt;
}*/&lt;br /&gt;
/*    Set all A ancor properties    */&lt;br /&gt;
#header .linkList0 li a&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
text-decoration: none;&lt;br /&gt;
line-height: 22px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    IE7: Fix for a bug in IE7 where the margins between list items is doubled - need to set height explicitly    */&lt;br /&gt;
*+html #header .linkList0 ul li&lt;br /&gt;
{&lt;br /&gt;
height: auto;&lt;br /&gt;
margin-bottom: -.3em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Menu:    Set different borders for different nested level lists&lt;br /&gt;
--------------------------------------------------------------    */&lt;br /&gt;
#header .linkList0 &amp;gt; li a&lt;br /&gt;
{&lt;br /&gt;
border-left: 10px solid Transparent;&lt;br /&gt;
border-right: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 &amp;gt; li a&lt;br /&gt;
{&lt;br /&gt;
border-left: 0px;&lt;br /&gt;
margin-left: 0px;&lt;br /&gt;
border-right: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 .linkList01 &amp;gt; li a&lt;br /&gt;
{&lt;br /&gt;
border-left: 8px solid #336699;&lt;br /&gt;
border-right: none;&lt;br /&gt;
border: 1px solid Transparent;&lt;br /&gt;
-moz-border-radius: 5px 5px 5px 5px;&lt;br /&gt;
-moz-box-shadow: 3px 3px 4px #696969;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 .linkList01 .linkList001 &amp;gt; li a&lt;br /&gt;
{&lt;br /&gt;
border-left: 6px solid #336699;&lt;br /&gt;
border-right: none;&lt;br /&gt;
border: 1px solid Transparent;&lt;br /&gt;
-moz-border-radius: 5px 5px 5px 5px;&lt;br /&gt;
-moz-box-shadow: 3px 3px 4px #696969;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 .linkList01 .linkList001 .linkList0001 &amp;gt; li a&lt;br /&gt;
{&lt;br /&gt;
border-left: 4px solid #336699;&lt;br /&gt;
border-right: none;&lt;br /&gt;
border: 1px solid Transparent;&lt;br /&gt;
-moz-border-radius: 5px 5px 5px 5px;&lt;br /&gt;
-moz-box-shadow: 3px 3px 4px #696969;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Link and Visited pseudo-class settings for all lists (ul)    */&lt;br /&gt;
#header .linkList0 a:link, #header .linkList0 a:visited&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
text-decoration: none;&lt;br /&gt;
padding-left: 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Hide all the nested/sub menu items    */&lt;br /&gt;
#header .linkList0 ul&lt;br /&gt;
{&lt;br /&gt;
display: none;&lt;br /&gt;
padding: 0;&lt;br /&gt;
position: absolute;    /*Important: must not impede on other page elements when drop down opens up    */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Hide all detail popups    */&lt;br /&gt;
#header .detailPopup&lt;br /&gt;
{&lt;br /&gt;
display: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set the typology of all sub-menu list items li    */&lt;br /&gt;
/*#header .linkList0 ul li&lt;br /&gt;
{&lt;br /&gt;
background-color: #AACCEE;&lt;br /&gt;
background-position: left center;&lt;br /&gt;
background-image: url(  &#39;../Content/Images/VerticalButtonBarGradientFade.png&#39; );&lt;br /&gt;
background-repeat: repeat-x;&lt;br /&gt;
background-attachment: scroll;&lt;br /&gt;
}*/&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 ul li.more&lt;br /&gt;
{&lt;br /&gt;
background: Transparent url(&#39;../Content/Images/ArrowRight.gif&#39;) no-repeat right center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Header list&#39;s margin and padding for all list items    */&lt;br /&gt;
#header .linkList0 ul li&lt;br /&gt;
{&lt;br /&gt;
margin: 0 0 0 1em;&lt;br /&gt;
padding: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList01 ul li&lt;br /&gt;
{&lt;br /&gt;
margin: 0;&lt;br /&gt;
padding: 0;&lt;br /&gt;
width: 189px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set margins for the third li sibling (Plan a Call) to display to the right of the parent menu&lt;br /&gt;
to avoid the sub-menu overlaying the menu items below    */&lt;br /&gt;
#header .linkList0 li.more .linkList01 li.more &amp;gt; ul.linkList001&lt;br /&gt;
{&lt;br /&gt;
margin: -1.7em 0 0 13.2em;    /*Important, must be careful, if tbe EM since gap increases too much bewteen nested lists the gap will make the nested-list collapse prematurely    */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set right hand arrow for list items with sub-menus (class-more)    */&lt;br /&gt;
#header li.more&lt;br /&gt;
{&lt;br /&gt;
background: Transparent url(&#39;../Content/Images/ArrowRight.gif&#39;) no-repeat right center;&lt;br /&gt;
padding-right: 48px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Menu:    Dynamic Behavior of menu items (hover, visted, etc)&lt;br /&gt;
-----------------------------------------------------------    */&lt;br /&gt;
#header .linkList0 li a:link, #header .linkList01 li a:link&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 li a:visited, #header .linkList01 li a:visited&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 &amp;gt; li:hover&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList01 &amp;gt; li:hover a&lt;br /&gt;
,#header .linkList001 &amp;gt; li:hover a&lt;br /&gt;
{&lt;br /&gt;
text-decoration: underline;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 &amp;gt; li abbr:hover span.detailPopup&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
position: absolute;&lt;br /&gt;
top: 1em;&lt;br /&gt;
left: 17em;&lt;br /&gt;
border: double 1px #696969;&lt;br /&gt;
border-style: outset;&lt;br /&gt;
width: 120%;&lt;br /&gt;
height: auto;&lt;br /&gt;
padding: 5px;&lt;br /&gt;
font-weight: 100;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 &amp;gt; li:hover&lt;br /&gt;
,#header .linkList0 .linkList01 &amp;gt; li:hover&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 .linkList01 .linkList001 &amp;gt; li:hover&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#header .linkList0 .linkList01 .linkList001 .linkList0001 &amp;gt; li:hover&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Display the hidden sub menu when hovering over the parent ul&#39;s li    */&lt;br /&gt;
#header .linkList0 li:hover &amp;gt; ul&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Display the hidden sub menu when hovering over the parent ul&#39;s li    */&lt;br /&gt;
#header .linkList0 .linkList01 li:hover &amp;gt; ul&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
background: -moz-linear-gradient(top, #1E83CC, #619FCD);&lt;br /&gt;
/* Chrome, Safari:*/&lt;br /&gt;
background: -webkit-gradient(linear,&lt;br /&gt;
center top, center bottom, from(#1E83CC), to(#619FCD));&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Display the hidden sub menu when hovering over the parent ul&#39;s li    */&lt;br /&gt;
#header .linkList0 .linkList01 .linkList001 li:hover &amp;gt; ul&lt;br /&gt;
{&lt;br /&gt;
display: block;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*    Set right hand arrow for list items with sub-menus (class-more) on hover    */&lt;br /&gt;
#header li.more:hover&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Also some CSS for global settings that will affect this menu, you of course will have some other styling, but included it here so you can see how/why some css properties were set here:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
/* Neutralize styling:&lt;br /&gt;
Elements we want to clean out entirely: */&lt;br /&gt;
html, body&lt;br /&gt;
{&lt;br /&gt;
margin: 0;&lt;br /&gt;
padding: 0;&lt;br /&gt;
font: 62.5%/120% Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Neutralize styling:&lt;br /&gt;
Elements with a vertical margin: */&lt;br /&gt;
h1, h2, h3, h4, h5, h6, p, pre,&lt;br /&gt;
blockquote, ul, ol, dl, address {&lt;br /&gt;
margin: 0;    /*    most browsers set some default value that is not shared by all browsers    */&lt;br /&gt;
padding: 0;        /*    some borowsers default padding, set to 0 for all    */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Apply left margin:&lt;br /&gt;
Only to the few elements that need it: */&lt;br /&gt;
li, dd, blockquote {&lt;br /&gt;
margin-left: 1em;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/8074338644606530722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2011/02/menu-widget-no-jquery-nor-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8074338644606530722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8074338644606530722'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2011/02/menu-widget-no-jquery-nor-javascript.html' title='Menu widget - no jQuery nor Javascript required - pure CSS'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-4518541733649044214</id><published>2011-02-10T06:17:00.000-08:00</published><updated>2011-02-10T06:18:32.172-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cellEdit"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamic"/><category scheme="http://www.blogger.com/atom/ns#" term="edittype: &quot;select&quot;"/><category scheme="http://www.blogger.com/atom/ns#" term="jqGrid"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>jqgrid - dynamically load different drop down values for different rows depending on another column value</title><content type='html'>&lt;h1&gt;Goal:&lt;/h1&gt;As we all know the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;  examples in the demo and the Wiki always refer to static values for  drop down boxes. This of course is a personal preference but in dynamic  design these values should be populated from the database/xml file, etc,  ideally JSON formatted.&lt;br /&gt;
Can you do this in &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;,  yes, but with some custom coding which we will briefly show below  (refer to some of my other blog entries for a more detailed discussion  on this topic).&lt;br /&gt;
What you CANNOT&amp;nbsp;do in &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;, referring here up and to version 3.8.x, is to load different drop down values for different rows in the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;. Well, not without some trickery, which is what this discussion is about.&lt;br /&gt;
&lt;h1&gt;Issue:&lt;/h1&gt;Of course the issue is that &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;  has been designed for high performance and thus I have no issue with  them loading a&amp;nbsp; reference to a single drop down values list for every  column. This way if you have 500 rows or one, each row only refers to a  single list for that particular column. Nice!&lt;br /&gt;
SO how easy would it be to simply traverse the grid once loaded on  gridComplete or loadComplete and simply load the select tag&#39;s options  from scratch, via Ajax, from memory variable, hard coded etc?  Impossible! Since their is no embedded SELECT tag within each cell  containing the drop down values (remember it only has a reference to  that list in memory), all you will see when you inspect the cell prior  to clicking on it, or even before and on beforeEditCell, is an empty  .&lt;br /&gt;
When trying to load that list via a click event on that cell will temporarily load the list but &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;&#39;s last internal callback event will remove it and replace it with the old one, and you are back to square one.&lt;br /&gt;
&lt;h1&gt;Solution:&lt;/h1&gt;Yes, after spending a few hours on this found a solution to the problem that does not require any updates to &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt; source code, thank GOD!&lt;br /&gt;
Before we get into the coding details, the solution here can of  course be customized to suite your specific needs, this one loads the  entire drop down list that would be needed across all rows once into  global variable. I then parse this object that contains all the  properties I need to filter the rows depending on which ones I want the  user to see based off of another cell value in that row. This only  happens when clicking the cell, so no performance penalty. You may of  course to load it via Ajax when the user clicks the cell, but I found it  more efficient to load the entire list as part of &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt;&#39;s  normal editoptions: { multiple: false, value: listingStatus } colModel  options which again keeps only a reference to the single list, no  duplication.&lt;br /&gt;
Lets get into the meat and potatoes of it.&lt;br /&gt;
&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var acctId = $(&#39;#Id&#39;).val();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var data = $.Ajax({ url:  $(&#39;#ajaxGetAllMaterialsTrackingLookupDataUrl&#39;).val(), data: { accountId:  acctId }, dataType: &#39;json&#39;, async: false, success: function(data,  result) { if (!result) alert(&#39;Failure to retrieve the Alert related  lookup data.&#39;); } }).responseText;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var lookupData = eval(&#39;(&#39; + data + &#39;)&#39;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3366ff;&quot;&gt;var listingCategory = lookupData.ListingCategory;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3366ff;&quot;&gt;var catList = &#39;{&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(lookupData.ListingCategory).each(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catList += this.Id + &#39;:&quot;&#39; + this.Name + &#39;&quot;,&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catList += &#39;}&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var lastsel;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ignoreAlert = true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(item)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .jqGrid({&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: listURL,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; postData: &#39;&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype: &quot;local&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colNames: [&#39;Id&#39;, &#39;Name&#39;, &#39;Commission&lt;br /&gt;
Rep&#39;,  &#39;Business&lt;br /&gt;
Group&#39;, &#39;Order&lt;br /&gt;
Date&#39;, &#39;Edit&#39;, &#39;TBD&#39;,  &#39;Month&#39;, &#39;Year&#39;, &#39;Week&#39;, &#39;Product&#39;, &#39;Product&lt;br /&gt;
Type&#39;,  &#39;Online/&lt;br /&gt;
Magazine&#39;, &#39;Materials&#39;, &#39;Special&lt;br /&gt;
Placement&#39;, &#39;Logo&#39;, &#39;Image&#39;, &#39;Text&#39;, &#39;Contact&lt;br /&gt;
Info&#39;,  &#39;Everthing&lt;br /&gt;
In&#39;, &#39;Category&#39;, &#39;Status&#39;],&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colModel: [&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { name: &#39;Id&#39;, index: &#39;Id&#39;, hidden: true, hidedlg: true },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { name: &#39;AccountName&#39;, index: &#39;AccountName&#39;, align: &quot;left&quot;, resizable: true, search: true, width: 100 },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { name: &#39;OnlineName&#39;, index: &#39;OnlineName&#39;, align: &#39;left&#39;, sortable: false, width: 80 },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3366ff;&quot;&gt;{ name:  &#39;ListingCategoryName&#39;, index: &#39;ListingCategoryName&#39;, width: 85,  editable: true, hidden: false, edittype: &quot;select&quot;, editoptions: {  multiple: false, value: eval(&#39;(&#39; + catList + &#39;)&#39;) }, editrules: {  required: false }, formatoptions: { disabled: false} }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ],&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jsonReader: {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; root: &quot;List&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; page: &quot;CurrentPage&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total: &quot;TotalPages&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; records: &quot;TotalRecords&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userdata: &quot;Errors&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; repeatitems: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: &quot;0&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowNum: $rows,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowList: [10, 20, 50, 200, 500, 1000, 2000],&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imgpath: jQueryImageRoot,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pager: $(item + &#39;Pager&#39;),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shrinkToFit: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 1455,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; recordtext: &#39;Traffic lines&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sortname: &#39;OrderDate&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; viewrecords: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sortorder: &quot;asc&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; altRows: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cellEdit: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cellsubmit: &quot;remote&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cellurl: editURL + &#39;?rows=&#39; + $rows + &#39;&amp;amp;page=1&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadComplete: function() {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gridComplete: function() {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadError: function(xhr, st, err) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #3366ff;&quot;&gt; afterEditCell: function(rowid, cellname, value, iRow, iCol) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var select = $(item).find(&#39;td.edit-cell select&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(item).find(&#39;td.edit-cell select option&#39;).each(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var option = $(this);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var optionId = $(this).val();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(lookupData.ListingCategory).each(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.Id == optionId) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.OnlineName != $(item).getCell(rowid, &#39;OnlineName&#39;)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;option.remove();&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; search: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchdata: {},&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; caption: &quot;List of all Traffic lines&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editurl: editURL + &#39;?rows=&#39; + $rows + &#39;&amp;amp;page=1&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hiddengrid: hideGrid&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the JSON data returned via the Ajax call during the &lt;a _fcksavedurl=&quot;http://www.trirand.com/blog/&quot; href=&quot;http://www.trirand.com/blog/&quot; rel=&quot;&quot; target=&quot;_blank&quot; title=&quot;jQuery Grid plugin&quot;&gt;jqGrid&lt;/a&gt; function call above (NOTE it must be { async: false}:&lt;br /&gt;
&lt;pre role=&quot;list&quot;&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;{&quot;ListingCategory&quot;:[{&quot;Id&quot;:29,&quot;Name&quot;:&quot;Document Imaging&quot;,&quot;OnlineName&quot;:&quot;RF Globalnet&quot;}   
,{&quot;Id&quot;&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;:1,&quot;Name&quot;:&quot;Ancillary Department&quot;,&quot;OnlineName&quot;:&quot;Healthcare Technology Online&quot;}&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre role=&quot;list&quot;&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;,{&quot;Id&quot;:2,&quot;Name&quot;&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;:&quot;Asset Tracking&quot;,&quot;OnlineName&quot;:&quot;Healthcare Technology Online&quot;}   
,{&quot;Id&quot;:3,&quot;Name&quot;:&quot;Asset Tracking&quot;,&quot;OnlineName&quot;&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;:&quot;&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;RF Globalnet&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;&quot;}   
,{&quot;Id&quot;:4,&quot;Name&quot;:&quot;Asset Tracking&quot;,&quot;OnlineName&quot;:&quot;ISMR&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;&quot;}   
,{&quot;Id&quot;:5,&quot;Name&quot;:&quot;Document Imaging&quot;,&quot;OnlineName&quot;:&quot;Healthcare Technology Online&quot;&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;} 
,{&quot;Id&quot;:6,&quot;Name&quot;:&quot;Document Imaging&quot;,&quot;OnlineName&quot;:&quot;&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;RF Globalnet&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;&quot;}   
,{&quot;Id&quot;:7&lt;/code&gt;&lt;code class=&quot;wrappedText focusRow&quot; role=&quot;listitem&quot;&gt;,&quot;Name&quot;:&quot;EMR/EHR Software&quot;,&quot;OnlineName&quot;:&quot;Healthcare Technology Online&quot;}&lt;/code&gt;]}
&lt;/pre&gt;I only need the Id and Name for the drop down list, but the third  column  in the JSON object is important, it is the only that I match up  with  the OnlineName in the jqGrid column, and then in the loop during   afterEditCell simply remove the ones I don&#39;t want the user to see.   That&#39;s it!</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/4518541733649044214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2011/02/jqgrid-dynamically-load-different-drop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/4518541733649044214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/4518541733649044214'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2011/02/jqgrid-dynamically-load-different-drop.html' title='jqgrid - dynamically load different drop down values for different rows depending on another column value'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-4243618522511381375</id><published>2010-12-30T14:09:00.000-08:00</published><updated>2011-02-25T05:48:56.050-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="1.4.2"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net Mvc"/><category scheme="http://www.blogger.com/atom/ns#" term="JsonRequestBehavior"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><title type='text'>Upgrade from Asp.Net MVC 1 to MVC 2 - how to and issues with JsonRequestBehavior</title><content type='html'>&lt;h3&gt;Goal&lt;/h3&gt;Upgrade your MVC 1 app to MVC 2&lt;br /&gt;
&lt;h3&gt;Issues&lt;/h3&gt;You  may get errors about your Json data being returned via a GET request  violating security principles - we also address this here. This post is  not intended to delve into why the Json GET request is or may be an issue, just how to resolve it as part of upgrading from MVC1 to 2.&lt;br /&gt;
&lt;h3&gt;Solution&lt;/h3&gt;First  remove all references from your projects to the MVC 1 dll and replace  it with the MVC 2 dll. Now update your web.config file in your web app  root folder by simply changing references to assembly=&quot;System.Web.Mvc,  Version 1.0.0.0 to Version 2.0.0.0, there are a couple of references in  your config file, here are probably most of them you may have:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style=&quot;color: red;&quot;&gt;compilation &lt;/span&gt;debug=&quot;true&quot; defaultLanguage=&quot;c#&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;assemblies&gt;&lt;br /&gt;
&lt;/assemblies&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;pages&gt;&lt;span style=&quot;color: red;&quot;&gt;masterPageFile&lt;/span&gt;=&quot;~/Views/Masters/CRMTemplate.master&quot; pageParserFilterType=&quot;System.Web.Mvc.ViewTypeParserFilter, &lt;span style=&quot;color: #339966;&quot;&gt;System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;&lt;/span&gt; pageBaseType=&quot;System.Web.Mvc.ViewPage, &lt;span style=&quot;color: #339966;&quot;&gt;System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span style=&quot;color: red;&quot;&gt;controls&lt;/span&gt;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;add 102);=&quot;&quot; 153,=&quot;&quot; assembly=&quot;&amp;lt;span style=&quot; color:=&quot;&quot; rgb(51,=&quot;&quot;&gt;System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot; namespace=&quot;System.Web.Mvc&quot; tagPrefix=&quot;mvc&quot; /&amp;gt;&lt;/add&gt;&lt;/pages&gt;&lt;/blockquote&gt;&lt;blockquote&gt;userControlBaseType=&quot;System.Web.Mvc.ViewUserControl, System.Web.Mvc,  Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;  validateRequest=&quot;False&quot;&amp;gt; &lt;/blockquote&gt;&lt;br /&gt;
Secondly, if you return Json objects from an ajax call via  the GET method you ahve several options to fix this depending on your  situation:&lt;br /&gt;
1. The simplest, as in my case I did this for an internal web app, you may simply do: &lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Json(myObject, &lt;span style=&quot;color: red;&quot;&gt;JsonRequestBehavior.AllowGet&lt;/span&gt;);&lt;/blockquote&gt;&lt;br /&gt;
2. In Mvc if you have a controller base you could wrap the Json method with:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public new JsonResult Json(object data)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Json(data, &quot;application/json&quot;, &lt;span style=&quot;color: red;&quot;&gt;JsonRequestBehavior.AllowGet&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/blockquote&gt;&lt;br /&gt;
3. The most work would be to decorate your Actions with:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [AcceptVerbs(HttpVerbs.Get)]&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
4. Another tnat is also a lot of work that needs to be done to every ajax call returning Json is:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg = $.ajax({ url: $(&#39;#ajaxGetSampleUrl&#39;).val(), &lt;span style=&quot;color: red;&quot;&gt;dataType: &#39;json&#39;, type: &#39;POST&#39;&lt;/span&gt;,  async: false, data: { name: theClass }, success: function(data, result)  { if (!result) alert(&#39;Failure to retrieve the Sample Data.&#39;); }  }).responseText;&lt;/blockquote&gt;&lt;br /&gt;
This should cover all the issues you may run into when upgrading. Let me kow if you run into any other ones.</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/4243618522511381375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/upgarde-from-aspnet-mvc-1-to-mvc-2-how.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/4243618522511381375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/4243618522511381375'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/upgarde-from-aspnet-mvc-1-to-mvc-2-how.html' title='Upgrade from Asp.Net MVC 1 to MVC 2 - how to and issues with JsonRequestBehavior'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-2488151512225680614</id><published>2010-12-30T09:58:00.000-08:00</published><updated>2010-12-30T09:58:07.526-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="1.4.2"/><category scheme="http://www.blogger.com/atom/ns#" term="1.4.4"/><category scheme="http://www.blogger.com/atom/ns#" term="attr"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="removeAttr"/><category scheme="http://www.blogger.com/atom/ns#" term="select"/><title type='text'>jQuery 1.4.4 - issue with attr(&#39;selected&#39;, null)</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Issue&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;
The code below worked before under version jQuery  1.4.2 but when I upgraded to version 1.4.4 it no longer worked as  expected - it did not unselect the list box item, only setting &quot;selectd&quot;  worked:&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _handleClick: function(elem) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var self = this; var initElem = this.element;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var checked = $(elem).attr(&#39;checked&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myId = elem.attr(&#39;id&#39;).replace(initElem.attr(&#39;id&#39;) + &#39;_chk_&#39;, &#39;&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; initElem.children(&#39;option[value=&#39; + myId + &#39;]&#39;).attr(&#39;selected&#39;, function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (checked) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &#39;selected&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else { return null; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($.isFunction(self.options.onItemSelected)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.options.onItemSelected(elem, initElem.children(&#39;option&#39;).get());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (ex) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (self.options.allowDebug)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&#39;select function failed: &#39; + ex.Description);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/blockquote&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;
Under jQuery 1.4.4 you need to explicitly remove the attribute as in &quot;removeAttr(&#39;selected&#39;):&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _handleClick: function(elem) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var self = this; var initElem = this.element;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var checked = $(elem).is(&#39;:checked&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myId = elem.attr(&#39;id&#39;).replace(initElem.attr(&#39;id&#39;) + &#39;_chk_&#39;, &#39;&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #339966;&quot;&gt;&amp;nbsp; if (checked) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339966;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initElem.children(&#39;option[value=&#39; + myId + &#39;]&#39;).attr(&#39;selected&#39;, &#39;selected&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339966;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339966;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initElem.children(&#39;option[value=&#39; + myId + &#39;]&#39;).removeAttr(&#39;selected&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339966;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($.isFunction(self.options.onItemSelected)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.options.onItemSelected(elem, initElem.children(&#39;option&#39;).get());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (ex) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (self.options.allowDebug)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&#39;select function failed: &#39; + ex.Description);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/2488151512225680614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/issue-code-below-worked-before-under.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/2488151512225680614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/2488151512225680614'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/issue-code-below-worked-before-under.html' title='jQuery 1.4.4 - issue with attr(&#39;selected&#39;, null)'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-7323228670514654945</id><published>2010-12-14T07:55:00.001-08:00</published><updated>2010-12-14T07:55:51.194-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="database"/><category scheme="http://www.blogger.com/atom/ns#" term="login"/><category scheme="http://www.blogger.com/atom/ns#" term="restore"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>After restoring a SQL Server database from another server - get login fails</title><content type='html'>&lt;h3&gt;Issue:&lt;/h3&gt;After you have restored a sql server database from another server, lets say from production to a Q/A environment, you get the &quot;Login Fails&quot; message for your service account.&lt;br /&gt;
&lt;h3&gt;Reason:&lt;/h3&gt;User logon information is stored in the syslogins table in     the master database. By changing servers, or by altering this information by     rebuilding or restoring an old version of the master database, the information     may be different from when the user database dump was created. If logons do not     exist for the users, they will receive an error indicating &quot;Login failed&quot; while     attempting to log on to the server. If the user logons do exist, but the SUID     values (for 6.x) or SID values (for 7.0) in master..syslogins and the sysusers     table in the user database differ, the users may have different permissions     than expected in the user database. &lt;br /&gt;
&lt;h3&gt;Solution:&lt;/h3&gt;Links  a user entry in the sys.database_principals system catalog view in the  current database to a SQL Server login of the same name. If a login with  the same name does not exist, one will be created. Examine the result  from the Auto_Fix statement to confirm that the correct link is in fact  made. Avoid using Auto_Fix in security-sensitive situations.&lt;br /&gt;
&lt;br /&gt;
When you use Auto_Fix, you must specify user and password if the login  does not already exist, otherwise you must specify user but password  will be ignored. login must be NULL. user must be a valid user in the  current database. The login cannot have another user mapped to it.&lt;br /&gt;
execute the following stored procedure, in this example the login user name is &quot;MyUser&quot;&lt;br /&gt;
&lt;strong&gt;exec sp_change_users_login &#39;Auto_Fix&#39;, &#39;MyUser&#39;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;NOTE:&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;sp_change_users_login&lt;/strong&gt; cannot be used with a SQL Server  login created from a Windows principal or with a user created by using  CREATE USER WITHOUT LOGIN.&lt;a href=&quot;http://geekswithblogs.net/renso/archive/2010/12/14/after-restoring-a-sql-server-database-from-another-server.aspx&quot; title=&quot;View Entry&quot;&gt;After restoring a SQL Server database from another server - get login fails&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/7323228670514654945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/after-restoring-sql-server-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/7323228670514654945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/7323228670514654945'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/after-restoring-sql-server-database.html' title='After restoring a SQL Server database from another server - get login fails'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-8397864222263101492</id><published>2010-12-02T13:48:00.000-08:00</published><updated>2010-12-02T13:48:33.999-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="file"/><category scheme="http://www.blogger.com/atom/ns#" term="httpRuntime"/><category scheme="http://www.blogger.com/atom/ns#" term="machine.config"/><category scheme="http://www.blogger.com/atom/ns#" term="upload"/><category scheme="http://www.blogger.com/atom/ns#" term="web.config"/><title type='text'>Maximum request length exceeded.</title><content type='html'>Issue:&lt;br /&gt;
The file upload size on your machine or web app is too small. The default file upload size for IIS is 4096K. The file size the user is trying to add can be retrieved (using the ELMAH log here) by looking at the Content-Length header property:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;HTTP_CONNECTION:keep-alive HTTP_KEEP_ALIVE:115 HTTP_CONTENT_LENGTH:&lt;span style=&quot;color: red;&quot;&gt;6414851&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
In this example it is just over 6Mb&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
You can add/update the HttpRuntime property in the machine or web config files, depending on at what level you want to set the size. For web-server level, impacting all web-apps running on that machine specify the following in the &lt;system.web&gt; node of the machine.config file to allow less than 1Mb:&lt;/system.web&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;httpRuntime maxRequestLength=&quot;1000&quot; /&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;
If you want to set it, bigger, smaller or block at the web-app level you can specify it by adding the property above to the web.config file of that web app and it will only affect that web app.&lt;br /&gt;
&lt;br /&gt;
For example I would like to maintain the default 4096K size limitation on my server except for the accounting web app and therefore set the accounting web-sites virtual directory web-config file to handle 8Mb file uploads:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;httpRuntime maxRequestLength=&quot;8192&quot; /&amp;gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/8397864222263101492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/maximum-request-length-exceeded.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8397864222263101492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8397864222263101492'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/maximum-request-length-exceeded.html' title='Maximum request length exceeded.'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-9086415255376405915</id><published>2010-12-02T05:31:00.000-08:00</published><updated>2010-12-02T10:50:09.073-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="path"/><category scheme="http://www.blogger.com/atom/ns#" term="regedit"/><category scheme="http://www.blogger.com/atom/ns#" term="Wndows"/><title type='text'>Resetting/Restoring the Windows PATH</title><content type='html'>&lt;h3&gt;Problem:&lt;/h3&gt;For some reason you lost your Windows PATH settings and want to restore the previous version:&lt;br /&gt;
&lt;h3&gt;Solution:&lt;/h3&gt;First of you may reset it to the original setting to:&lt;br /&gt;
&lt;br /&gt;
Windows XP: &amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths}&lt;br /&gt;
Windows 7: &amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths}&lt;br /&gt;
&lt;br /&gt;
Alternatively  you could look for some previous version of the path in the registry.  In Windows 7 you would look for &quot;Path&quot; name under  Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session  Manager\Environment. If you do not see the previous version of what you  would expect, continue down the list &quot;ControlSet002&quot;, &quot;..03&quot;, etc. The  current version will be under  Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\....</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/9086415255376405915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/resettingrestoring-my-windows-path.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/9086415255376405915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/9086415255376405915'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/12/resettingrestoring-my-windows-path.html' title='Resetting/Restoring the Windows PATH'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-8237523607632982610</id><published>2010-11-30T10:14:00.000-08:00</published><updated>2010-11-30T10:25:19.421-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="combine"/><category scheme="http://www.blogger.com/atom/ns#" term="compression"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="js"/><category scheme="http://www.blogger.com/atom/ns#" term="minification"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><title type='text'>Combine and compress javascript and css files in ASP.Net MVC</title><content type='html'>&lt;h3&gt;Goal:&lt;/h3&gt;&lt;p&gt;When loading js or css files, combine all the js files into one and all css files into one file respectively when rendering to improve on performance. Also compress if need be on the fly.&lt;/p&gt;&lt;p&gt;In this example we use many css files and even more js files to organize the ASP.Net Mvc web app into manageable pieces. The reason for the separation is mainly because it gives the team the ability to work on different part of the web app by working on the affected css or js files. It also helps to decide at a very granular level which css or js files to load and cache in the browser and which ones are very unique and/or specific and/or large so as to load only when really needed. For example I have an extremely large contract page with about 4000 lines of jQuery to handle a spreadsheet like functionality. It is not used often and used only by certain sales reps. Do not want to load this file as part of the generic/global js file since it would be wasted space for most part. This file is loaded on the fly when needed. How that is done is another story :-) Since my app is a CRM app, it has many screens that have unique css styling requirements and so in some situations the css file should only be loaded when needed. The reasons are really not that important in the context of this blog, just want to show you how to do this in ASP.Net Mvc if and when the need arises.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;System Requirements:&lt;/h3&gt;&lt;p&gt;.Net 2+&lt;/p&gt;&lt;p&gt;ASP.Net Mvc v1+&lt;/p&gt;&lt;h3&gt;Solution:&lt;/h3&gt;&lt;br /&gt;&lt;h4&gt;In your Master file head section&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&amp;lt;%=Url.RouteUrl(new {controller = &quot;Scripts&quot;, Action = &quot;GetAllCss&quot;})%&amp;gt;&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;&amp;lt;%=Url.RouteUrl(new {controller = &quot;Scripts&quot;, Action = &quot;GetAllScripts&quot;})%&amp;gt;&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;h4&gt;In the Mvc ScriptController controller:&lt;/h4&gt;&lt;br /&gt;&lt;p&gt; &lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;       public static IPathMapper ServerPathMapper { get; set; }&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;        protected static bool Enable;&lt;br /&gt;&lt;br /&gt;      protected static bool EnableHtmlCompression;&lt;br /&gt;&lt;br /&gt;      protected static bool EnableHtmlMinification;&lt;br /&gt;&lt;br /&gt;      protected static bool EnableProfiler;&lt;br /&gt;&lt;br /&gt;      protected static bool EnableScriptCompression;&lt;br /&gt;&lt;br /&gt;      protected static bool EnableScriptMinification;&lt;br /&gt;&lt;br /&gt;      protected string Css = &quot;css&quot;;&lt;br /&gt;&lt;br /&gt;      protected string Js = &quot;js&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;        [OutputCacheAttribute(CacheProfile = &quot;Scripts&quot;)]&lt;br /&gt;&lt;br /&gt;      public FileResult GetAllScripts()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          StringBuilder sb = LoadjQueryScripts();&lt;br /&gt;&lt;br /&gt;          sb.Append(LoadCRMScripts());&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          return StreamText(sb.ToString(), Js);&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;        [OutputCacheAttribute(CacheProfile = &quot;CRMScripts&quot;)]&lt;br /&gt;&lt;br /&gt;      public static StringBuilder LoadjQueryScripts()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          string min = &quot;&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          if (ScriptOptimizerConfig.EnableMinimizedFileLoad)&lt;br /&gt;&lt;br /&gt;              min = &quot;Min/&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          var sb = new StringBuilder(CombineLikeDirectoryFiles(String.Format(&quot;~/Scripts/jquery/Base/{0}&quot;, min), FileType.js));&lt;br /&gt;&lt;br /&gt;          //var sb = new StringBuilder(CombineLikeDirectoryFiles(String.Format(&quot;~/Scripts/jquery/Plugins/{0}&quot;, min), FileType.js));&lt;br /&gt;&lt;br /&gt;          sb.Append(CombineLikeDirectoryFiles(String.Format(&quot;~/Scripts/jquery/Plugins/{0}&quot;, min), FileType.js));&lt;br /&gt;&lt;br /&gt;          sb.Append(CombineLikeDirectoryFiles(String.Format(&quot;~/Scripts/jquery/Plugins/jquery.grid/{0}&quot;, min), FileType.js));&lt;br /&gt;&lt;br /&gt;          sb.Append(CombineLikeDirectoryFiles(String.Format(&quot;~/Scripts/jquery/Plugins/jquery.datepick/{0}&quot;, min), FileType.js));&lt;br /&gt;&lt;br /&gt;          sb.Append(CombineLikeDirectoryFiles(String.Format(&quot;~/Scripts/jquery/Plugins/jquery.flot/{0}&quot;, min), FileType.js));&lt;br /&gt;&lt;br /&gt;          return sb;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       [OutputCacheAttribute(CacheProfile = &quot;CRMScripts&quot;)]&lt;br /&gt;&lt;br /&gt;      public static StringBuilder LoadCRMScripts()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          string pathForCRMScripts = GetPathForCRMScripts();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          if (ScriptOptimizerConfig.EnableMinimizedFileLoad)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              string newPathForCRM = pathForCRMScripts + &quot;Min/&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;              if (Directory.Exists(ServerMapPath(newPathForCRM)))&lt;br /&gt;&lt;br /&gt;                  pathForCRMScripts = newPathForCRM;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          var sb = new StringBuilder(GetFile(pathForCRMScripts, &quot;CRMScripting.js&quot;));&lt;br /&gt;&lt;br /&gt;          sb.Append(GetFile(pathForCRMScripts, &quot;CRMScriptingAccount.js&quot;));&lt;br /&gt;&lt;br /&gt;          sb.Append(GetFile(pathForCRMScripts, &quot;CRMScriptingContact.js&quot;));&lt;br /&gt;&lt;br /&gt;          sb.Append(GetFile(pathForCRMScripts, &quot;CRMScriptingCallSheet.js&quot;));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          return sb;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;        public FileStreamResult StreamText(string inputText, IEquatable&amp;lt;string&amp;gt; name)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          if (name.Equals(Js) &amp;amp;&amp;amp; ScriptOptimizerConfig.Enable &amp;amp;&amp;amp; ScriptOptimizerConfig.EnableScriptMinification)&lt;br /&gt;&lt;br /&gt;              inputText = new JavaScriptCompressor(inputText, false).Compress();&lt;br /&gt;&lt;br /&gt;          if (name.Equals(Css) &amp;amp;&amp;amp; ScriptOptimizerConfig.Enable &amp;amp;&amp;amp; ScriptOptimizerConfig.EnableCssMinification)&lt;br /&gt;&lt;br /&gt;              inputText = CssCompressor.Compress(inputText, 0, CssCompressionType.MichaelAshRegexEnhancements);&lt;br /&gt;&lt;br /&gt;          var m = new MemoryStream(Encoding.Default.GetBytes(inputText));&lt;br /&gt;&lt;br /&gt;          return File(m, name.Equals(Css) ? &quot;text/css&quot; : &quot;text/javascript&quot;);&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public static string CombineLikeDirectoryFiles(string directory, FileType typeOfFile)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          string combinedFiles = string.Empty;&lt;br /&gt;&lt;br /&gt;          string extension = null;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          switch (typeOfFile)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              case FileType.js:&lt;br /&gt;&lt;br /&gt;                  extension = &quot;js&quot;;&lt;br /&gt;&lt;br /&gt;                  if (ScriptOptimizerConfig.EnableMinimizedFileLoad)&lt;br /&gt;&lt;br /&gt;                  {&lt;br /&gt;&lt;br /&gt;                      string newPath = string.Format(&quot;{0}{1}&quot;, directory, directory.EndsWith(&quot;/&quot;) ? &quot;Min&quot; : &quot;/Min&quot;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                      if (Directory.Exists(ServerMapPath(newPath)))&lt;br /&gt;&lt;br /&gt;                          directory = newPath;&lt;br /&gt;&lt;br /&gt;                  }&lt;br /&gt;&lt;br /&gt;                  break;&lt;br /&gt;&lt;br /&gt;              case FileType.css:&lt;br /&gt;&lt;br /&gt;                  extension = &quot;css&quot;;&lt;br /&gt;&lt;br /&gt;                  break;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          if(extension == null)&lt;br /&gt;&lt;br /&gt;              return null;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          if (GetFiles(directory, extension) != null)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              foreach (FileInfo file in GetFiles(directory, extension))&lt;br /&gt;&lt;br /&gt;              {&lt;br /&gt;&lt;br /&gt;                  using (var s = new StreamReader(file.FullName))&lt;br /&gt;&lt;br /&gt;                      combinedFiles += s.ReadToEnd();&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;&lt;br /&gt;          } return combinedFiles;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public static string GetFile(string pathForCRMScripts, string file)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          if (ServerPathMapper != null)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              string fullFilePath = ServerPathMapper.MapPath(pathForCRMScripts) + file;&lt;br /&gt;&lt;br /&gt;              if (!System.IO.File.Exists(fullFilePath))&lt;br /&gt;&lt;br /&gt;                  return null;&lt;br /&gt;&lt;br /&gt;              using (var s = new StreamReader(fullFilePath))&lt;br /&gt;&lt;br /&gt;                  return s.ReadToEnd();&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          return null;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public static IList&amp;lt;FileInfo&amp;gt; GetFiles(string serverPath, string extention)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          string path = ServerMapPath(serverPath);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          if (!Directory.Exists(path))&lt;br /&gt;&lt;br /&gt;              return null;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          IList&amp;lt;FileInfo&amp;gt; files = new List&amp;lt;FileInfo&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          string[] fileNames = Directory.GetFiles(path, &quot;*.&quot; + extention, SearchOption.TopDirectoryOnly);&lt;br /&gt;&lt;br /&gt;          foreach (string name in fileNames)&lt;br /&gt;&lt;br /&gt;              files.Add(new FileInfo(name));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          return files;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public static string ServerMapPath(string serverPath)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          if (!serverPath.StartsWith(&quot;~/&quot;))&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              if (serverPath.StartsWith(&quot;/&quot;))&lt;br /&gt;&lt;br /&gt;                  serverPath = &quot;~&quot; + serverPath;&lt;br /&gt;&lt;br /&gt;              else&lt;br /&gt;&lt;br /&gt;                  serverPath = &quot;~/&quot; + serverPath;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          if (ServerPathMapper != null)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              string path = ServerPathMapper.MapPath(serverPath);&lt;br /&gt;&lt;br /&gt;              if (!path.EndsWith(&quot;/&quot;))&lt;br /&gt;&lt;br /&gt;                  path = path + &quot;/&quot;;&lt;br /&gt;&lt;br /&gt;              return path;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          return null;&lt;br /&gt;&lt;br /&gt;      }&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;        public static string GetPathForCRMScripts()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          return &quot;~/Scripts/CRM/&quot;;&lt;br /&gt;&lt;br /&gt;      }&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;    public interface IPathMapper&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;      string MapPath(string relativePath);&lt;br /&gt;&lt;br /&gt;      string MapPath();&lt;br /&gt;&lt;br /&gt;  }&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;The IPathMapper is injected via the ScriptController&#39;s constructor via IoC with Castle Windsor&#39;s windsor.boo config file:&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;Component &quot;pathMapper&quot;, IPathMapper, Vert.CRM.UI.Mechanics.ServerPathMapper&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;  public class ServerPathMapper : IPathMapper&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;      private readonly string _relativePath;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public ServerPathMapper()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public ServerPathMapper(string relativePath)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          _relativePath = relativePath;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      #region Implementation of IPathMapper&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public string MapPath(string relativePath)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          return HttpContext.Current.Server.MapPath(relativePath);&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public string MapPath()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          if (_relativePath != null)&lt;br /&gt;&lt;br /&gt;              if (HttpContext.Current != null) return HttpContext.Current.Server.MapPath(_relativePath);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          return null;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      #endregion&lt;br /&gt;&lt;br /&gt;  }&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;The static properties to enable profiler, compression, minification is set by using the ScriptOptimizerSection class which inherits from ConfigurationSection:&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;    public class ScriptOptimizerSection : ConfigurationSection {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enable&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool Enable {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enable&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enable&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableProfiler&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableProfiler {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableProfiler&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableProfiler&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableScriptCompression&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableScriptCompression {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableScriptCompression&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableScriptCompression&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableHtmlCompression&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableHtmlCompression {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableHtmlCompression&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableHtmlCompression&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableScriptMinification&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableScriptMinification {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableScriptMinification&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableScriptMinification&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableHtmlMinification&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableHtmlMinification {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableHtmlMinification&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableHtmlMinification&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableCssMinification&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableCssMinification {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableCssMinification&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableCssMinification&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      [ConfigurationProperty(&quot;enableMinimizedFileLoad&quot;, IsRequired = true)]&lt;br /&gt;&lt;br /&gt;      public bool EnableMinimizedFileLoad&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          get { return (bool)this[&quot;enableMinimizedFileLoad&quot;]; }&lt;br /&gt;&lt;br /&gt;          set { this[&quot;enableMinimizedFileLoad&quot;] = value; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  public class ScriptOptimizerConfig {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      protected static bool enable;&lt;br /&gt;&lt;br /&gt;      protected static bool enableProfiler;&lt;br /&gt;&lt;br /&gt;      protected static bool enableScriptCompression;&lt;br /&gt;&lt;br /&gt;      protected static bool enableHtmlCompression;&lt;br /&gt;&lt;br /&gt;      protected static bool enableScriptMinification;&lt;br /&gt;&lt;br /&gt;      protected static bool enableHtmlMinification;&lt;br /&gt;&lt;br /&gt;      protected static bool enableCssMinification;&lt;br /&gt;&lt;br /&gt;      protected static bool enableMinimizedFileLoad;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      static ScriptOptimizerConfig() {&lt;br /&gt;&lt;br /&gt;          ScriptOptimizerSection section;&lt;br /&gt;&lt;br /&gt;          section = (ScriptOptimizerSection)ConfigurationManager.GetSection(&quot;OptimizeClientSide&quot;);&lt;br /&gt;&lt;br /&gt;          if (section != null)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              enable = section.Enable;&lt;br /&gt;&lt;br /&gt;              enableProfiler = section.EnableProfiler;&lt;br /&gt;&lt;br /&gt;              enableScriptCompression = section.EnableScriptCompression;&lt;br /&gt;&lt;br /&gt;              enableHtmlCompression = section.EnableHtmlCompression;&lt;br /&gt;&lt;br /&gt;              enableScriptMinification = section.EnableScriptMinification;&lt;br /&gt;&lt;br /&gt;              enableHtmlMinification = section.EnableHtmlMinification;&lt;br /&gt;&lt;br /&gt;              enableCssMinification = section.EnableCssMinification;&lt;br /&gt;&lt;br /&gt;              enableMinimizedFileLoad = section.EnableMinimizedFileLoad;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool Enable {&lt;br /&gt;&lt;br /&gt;          get { return enable; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableProfiler {&lt;br /&gt;&lt;br /&gt;          get { return enableProfiler; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableScriptCompression {&lt;br /&gt;&lt;br /&gt;          get { return enableScriptCompression; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableHtmlCompression {&lt;br /&gt;&lt;br /&gt;          get { return enableHtmlCompression; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableScriptMinification {&lt;br /&gt;&lt;br /&gt;          get { return enableScriptMinification; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableMinimizedFileLoad&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          get { return enableMinimizedFileLoad; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      ///&lt;br /&gt;&lt;br /&gt;      /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableHtmlMinification {&lt;br /&gt;&lt;br /&gt;          get { return enableHtmlMinification; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public static bool EnableCssMinification&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          get { return enableCssMinification; }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;  }&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;The web.config file settings for optimization settings:&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;code&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;configSections&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;sectionGroup name=&quot;elmah&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;          &amp;lt;section name=&quot;errorLog&quot; type=&quot;Elmah.ErrorLogSectionHandler,Elmah&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;/sectionGroup&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;section name=&quot;OptimizeClientSide&quot; type=&quot;Vert.CRM.Core.Utility.ScriptOptimizerSection, Vert.CRM.Core&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;....&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;code&gt;    &amp;lt;OptimizeClientSide enable=&quot;false&quot;&lt;br /&gt;&lt;br /&gt;    enableScriptCompression=&quot;false&quot;&lt;br /&gt;&lt;br /&gt;    enableHtmlCompression=&quot;false&quot;&lt;br /&gt;&lt;br /&gt;    enableScriptMinification=&quot;false&quot;&lt;br /&gt;&lt;br /&gt;    enableMinimizedFileLoad=&quot;true&quot;&lt;br /&gt;&lt;br /&gt;    enableHtmlMinification=&quot;false&quot;&lt;br /&gt;&lt;br /&gt;    enableCssMinification=&quot;false&quot;&lt;br /&gt;&lt;br /&gt;    enableProfiler=&quot;false&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/OptimizeClientSide&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/8237523607632982610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/combine-and-compress-javascript-and-css.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8237523607632982610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8237523607632982610'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/combine-and-compress-javascript-and-css.html' title='Combine and compress javascript and css files in ASP.Net MVC'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-2809748487909886439</id><published>2010-11-24T07:28:00.000-08:00</published><updated>2010-11-24T07:38:53.352-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="link"/><category scheme="http://www.blogger.com/atom/ns#" term="stylelsheet"/><title type='text'>Loading CSS stylesheet for ascx ASP.Net user control</title><content type='html'>&lt;h3&gt;Goal:&lt;/h3&gt;&lt;p&gt;For performance reasons you want to load a piece of CSS only for the ascx file to which it applies. You do not want to embed the style as you cannot do this in ASP.Net ascx user controls. ASP.Net will render the style tag as HTML text.&lt;/p&gt;&lt;h3&gt;Solution:&lt;/h3&gt;&lt;p&gt;Some folks use the Page.Header.Controls.Add to add the stylesheet link in the ascx page or in the code behind. Not needed, you may specify a &quot;link&quot; tag in the ascx file, not need to specify &quot;head&quot; tag or anything else, just the link tag itself:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;link rel=&quot;Stylesheet&quot; media=&quot;screen&quot; type=&quot;text/css&quot; href=&quot;&amp;lt;%=ResolveUrl(&quot;~/Content/StyleSheets/Screen/Global/CssCRMUITrafficLine.css&quot;) %&amp;gt;&quot; /&amp;gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The benefits are significant in that it is only loaded when needed. Personally I also prefix all my css selectors with the unique ID of the ascx container (i.e. I give the outer most div of my ascx page a unique name - usually that of the ascx file name) so that when I nest the ascx file into any other file the nested dynamically loaded CSS to not affect anything else outside of its scope. Also, since the stylesheet is linked it is &lt;strong&gt;cached &lt;/strong&gt;on the user&#39;s browser once it has been loaded.&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/2809748487909886439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/loading-css-stylesheet-for-ascx-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/2809748487909886439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/2809748487909886439'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/loading-css-stylesheet-for-ascx-aspnet.html' title='Loading CSS stylesheet for ascx ASP.Net user control'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-1355883367866881239</id><published>2010-11-24T06:25:00.000-08:00</published><updated>2010-11-24T06:27:36.111-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="attr"/><category scheme="http://www.blogger.com/atom/ns#" term="data"/><category scheme="http://www.blogger.com/atom/ns#" term="DHTML"/><category scheme="http://www.blogger.com/atom/ns#" term="DOM"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to store arbitrary data in the DOM using jQuery</title><content type='html'>&lt;h3&gt;&lt;strong&gt;Goal: &lt;/strong&gt;&lt;/h3&gt;Storing arbitrary data inside the DOM&lt;br /&gt;&lt;h3&gt;Issue:&lt;/h3&gt;&lt;p&gt;&lt;span class=&quot;pd&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;span class=&quot;pd&quot;&gt;Storing data   : $&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;).&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;attr&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;my data&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;c&quot;&gt;Retrieving data: &lt;/span&gt;&lt;span class=&quot;pd&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;).&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;attr&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The ALT attribute is designed to be an alternative text description.  For images the ALT text displays before the image is loaded.  ALT is a required element for images and can only  be used for image tags because its specific purpose is to describe  images.So therefore, &quot;alt&quot; is an HTML attribute meant to give the tag meaning and not to store data. Also if you want to store the same data for different DOM objects than the data is duplicated for every DOM property found in the selector&lt;/p&gt;&lt;h3&gt;The solution:&lt;/h3&gt;&lt;pre&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;span class=&quot;pd&quot;&gt;Storing data   : $&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;).&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;data&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;my data&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;);&lt;span class=&quot;pd&quot;&gt;                  $&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;).&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;data&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;, function() { do something } );&lt;br /&gt;&lt;span class=&quot;pd&quot;&gt;Retrieving data: $&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;).&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;data&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;key&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;The data is not stored in the DOM, it is stored jQuery&#39;s reference to that object, so for each target found by the selector only a reference is stored and the data is stored once and referenced as many times as needed.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/1355883367866881239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/how-to-store-arbitrary-data-in-dom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1355883367866881239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1355883367866881239'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/how-to-store-arbitrary-data-in-dom.html' title='How to store arbitrary data in the DOM using jQuery'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-1204549971231333267</id><published>2010-11-22T09:51:00.000-08:00</published><updated>2010-11-22T09:54:10.147-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="image"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>Images do not appear on my SSR report</title><content type='html'>&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;/p&gt;You dynamically (or not) set the &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;URL&lt;/span&gt; for the image you want to display in an &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;SSRS&lt;/span&gt; report but it does not &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_2&quot;&gt;display&lt;/span&gt; the image (red x).&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The reason:&lt;/strong&gt;&lt;/p&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_3&quot;&gt;SSRS&lt;/span&gt; access the images folder with anonymous access which is be default not allowed in &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_4&quot;&gt;IIS&lt;/span&gt;7 (not sure about &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_5&quot;&gt;IIS&lt;/span&gt;6 and prior versions).&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The solution:&lt;/strong&gt;&lt;/p&gt;Make sure anonymous access is allowed to that images folder where the image resides that you are referencing via &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_6&quot;&gt;URL&lt;/span&gt; in &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_7&quot;&gt;SSRS&lt;/span&gt; Report. Also make sure that &lt;strong&gt;anonymous access is set to ENABLED in &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_8&quot;&gt;IIS&lt;/span&gt;&lt;/strong&gt; for that same folder. If you set the security on the folder for anonymous to read only you will not have issues with someone deleting your images.</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/1204549971231333267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/images-do-not-appear-on-my-ssr-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1204549971231333267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1204549971231333267'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/images-do-not-appear-on-my-ssr-report.html' title='Images do not appear on my SSR report'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-6264398932801149004</id><published>2010-11-03T06:44:00.001-07:00</published><updated>2010-11-03T06:44:55.643-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="selectindex"/><title type='text'>Setting select option index in jQuery</title><content type='html'>&lt;p&gt;$(&#39;#myselect option:eq(1)&#39;).attr(&#39;selected&#39;, &#39;selected&#39;);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This will select the first option&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/6264398932801149004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/setting-select-option-index-in-jquery.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/6264398932801149004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/6264398932801149004'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/11/setting-select-option-index-in-jquery.html' title='Setting select option index in jQuery'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-8556096148690723438</id><published>2010-10-12T12:05:00.000-07:00</published><updated>2010-10-12T12:06:16.384-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>jQuery - Get the text value of a single value selected from a drop down box</title><content type='html'>&lt;h1&gt;Goal:&lt;/h1&gt;&lt;br /&gt;&lt;h2&gt;Get the text value of a single option selected from a drop down box&lt;/h2&gt;&lt;br /&gt;&lt;h1&gt;Solution:&lt;/h1&gt;&lt;br /&gt;&lt;p&gt;You have a drop down box called ALaCarteDiscount&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-size:large;&quot;&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;blockquote&gt;$(&#39;#ALaCarteDiscount option:selected&#39;).&lt;strong&gt;text()&lt;/strong&gt;&lt;/blockquote&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/8556096148690723438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/10/jquery-get-text-value-of-single-value.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8556096148690723438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/8556096148690723438'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/10/jquery-get-text-value-of-single-value.html' title='jQuery - Get the text value of a single value selected from a drop down box'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-645553259291634295</id><published>2010-07-20T14:23:00.000-07:00</published><updated>2010-07-20T14:24:07.695-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cichlids"/><title type='text'>Large Cichlids</title><content type='html'>&lt;p&gt;List of large Cichlids like Oscars, Jack Dempsey and the Electric Blue Jack Dempsey:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://animal-world.com/encyclo/fresh/cichlid/LargeCichlidsAmerican.php&quot; name=&quot;LargeCichlidsAmerican&quot;&gt;Large Cichlids&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/645553259291634295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/07/large-cichlids.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/645553259291634295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/645553259291634295'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/07/large-cichlids.html' title='Large Cichlids'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-1854765169752461996</id><published>2010-06-28T14:26:00.000-07:00</published><updated>2010-06-28T14:27:54.663-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRUD"/><category scheme="http://www.blogger.com/atom/ns#" term="DHTML"/><category scheme="http://www.blogger.com/atom/ns#" term="formedit"/><category scheme="http://www.blogger.com/atom/ns#" term="jqGrid"/><title type='text'>How to dynamically add Edit button to grid for editing row using the jqGrid formedit</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Goal:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Dynamically add an Edit button to an empty column  that will NOT trigger an inline edit but rather a jqGrid formedit for  the selected row using the modal dialog option.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Problem:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;All  examples in the Demo version include editing inline and adding buttons  to a column that only does an inline edit and the Demo version&#39;s  getRowdata does not perform as expected. I tried it an could not get it  working and the getRowData did not work as specified.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;             gridComplete: function() {&lt;br /&gt;                var rows = $(item).jqGrid(&#39;getRowData&#39;);&lt;br /&gt;                for (var i = 0; i &lt; &lt;strong&gt;rows[0].rows.length&lt;/strong&gt;;  i++) {&lt;br /&gt;                    var row = rows[0].rows[i];&lt;br /&gt;                    var idx = row.id;&lt;br /&gt;                    if (!$(row).hasClass(&#39;jqgrow&#39;) &amp;amp;&amp;amp;  !$(row).hasClass(&#39;alt&#39;))&lt;br /&gt;                        continue;&lt;br /&gt;                    var be = &quot;&lt;input style=&quot;&#39;height:22px;width:35px;&#39;&quot; type=&quot;&#39;button&#39;&quot; id=&quot;&#39;editAddress&quot; value=&quot;&#39;Edit&#39;&quot;&gt;&quot;;&lt;br /&gt;                    $(item).setRowData(idx, { act: be });&lt;br /&gt;                    $(&#39;#editAddress&#39; + idx).click(function() {&lt;br /&gt;                        &lt;strong&gt;$(item).editGridRow($(this).parent().parent(&#39;tr&#39;).attr(&#39;id&#39;));&lt;/strong&gt;&lt;br /&gt;                    });&lt;br /&gt;                }&lt;br /&gt;            },&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;item = that is a variable that contains the id of my grid.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This  is for editing an address so change the &quot;editAddress&quot; id prefix for  your needs or create a generic function that will handle all of this:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;             gridComplete: function() {&lt;br /&gt;                SetupJqGridEditDeleteButtons(item);&lt;br /&gt;            },&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;function SetupJqGridEditDeleteButtons(item) {&lt;br /&gt;    var rows = $(item).jqGrid(&#39;getRowData&#39;);&lt;br /&gt;    for (var i = 0; i &lt; rows[0].rows.length; i++) {&lt;br /&gt;        var row = rows[0].rows[i];&lt;br /&gt;        var idx = row.id;&lt;br /&gt;        if (!$(row).hasClass(&#39;jqgrow&#39;) &amp;amp;&amp;amp;  !$(row).hasClass(&#39;alt&#39;))&lt;br /&gt;            continue;&lt;br /&gt;        var be = &quot;&lt;input style=&quot;&#39;height:22px;width:35px;&#39;&quot; type=&quot;&#39;button&#39;&quot; id=&quot;&#39;editItem&quot; value=&quot;&#39;Edit&#39;&quot;&gt;&quot;;&lt;br /&gt;        $(item).setRowData(idx, { act: be });&lt;br /&gt;        $(&#39;#editItem&#39; + idx).click(function() {&lt;br /&gt;             $(item).editGridRow($(this).parent().parent(&#39;tr&#39;).attr(&#39;id&#39;));&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/1854765169752461996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/06/how-to-dynamically-add-edit-button-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1854765169752461996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1854765169752461996'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/06/how-to-dynamically-add-edit-button-to.html' title='How to dynamically add Edit button to grid for editing row using the jqGrid formedit'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-1057663256699220136</id><published>2010-06-14T13:21:00.000-07:00</published><updated>2010-06-14T13:22:29.827-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BDD"/><category scheme="http://www.blogger.com/atom/ns#" term="Red_Light-Green-Light"/><category scheme="http://www.blogger.com/atom/ns#" term="TDD"/><category scheme="http://www.blogger.com/atom/ns#" term="Unit testing"/><title type='text'>TDD - Red-Light-Green_Light:: A critical view</title><content type='html'>&lt;h3&gt;Subject: The concept of &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;red-light-green-light  for TDD/BDD&lt;/span&gt; style testing has been around since the dawn of time  (well almost). Having written thousands of tests using this approach I  find myself questioning the validity of the principle&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;The  issue:&lt;br /&gt;&lt;/h3&gt;&lt;p&gt;False positive or a valid test strategy that can be  trusted?&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;A critical view:&lt;br /&gt;&lt;/h3&gt;&lt;p&gt;I agree that the  red-green-light concept has some validity, but who has ever written 2000  tests for a system that goes through a ton of chnages due to the  organic nature fo the application and does not have to change, delete or  restructure their existing tests? If you asnwer to the latter question  is&quot; &quot;Yes I had a situation(s) where I had to refactor my code and it  caused me to have to rewrite/change/delete my existing tests&quot;, read on,  else press CTRL+ALT+Del :-)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Once a test has been written,  failed the test (red light), and then you comlpete your code and now get  the green light for the last test, the test for that functionality is  now in green light mode. It can never return to red light again as long  as the test exists, even if the test itself is not changed, and only the  code it tests is changed to fail the test. Why you ask? because the  reason for the initial red-light when you created the test is not  guaranteed to have triggered the initial red-light result for the same  reasons it is now failing after a code change has been made.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Furthermore,  when the same test is changed to compile correctly in case of a  compile-breaking code change, the green-light once again has been  invalidated. Why? Because there is no guarantee that the test code fix  is in the same green-light state as it was when it first ran  successfully.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To make matters worse, if you fix a  compile-breaking test without going through the red-light-green-light  test process, your test fix is essentially useless and very dangerous as  it now provides you with a false-positive at best. Thinking your code  has passed all tests and that it works correctly is far worse than not  having any tests at all, well at least for that part of the system that  the test-code represents.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;What to do?&lt;br /&gt;&lt;/h3&gt;&lt;p&gt;My  recommendation is to &lt;strong&gt;delete the tests affected, and re-create  them from scratch&lt;/strong&gt;. I have to agree. Hard to do and justify if  it has a significant impact on project deadlines.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;background-color: rgb(255, 0, 0);&quot;&gt;What do you think?&lt;/span&gt;&lt;br /&gt;&lt;/h3&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/1057663256699220136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/06/tdd-red-light-greenlight-critical-view.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1057663256699220136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1057663256699220136'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/06/tdd-red-light-greenlight-critical-view.html' title='TDD - Red-Light-Green_Light:: A critical view'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-539382896927854913</id><published>2010-04-30T09:34:00.000-07:00</published><updated>2010-04-30T09:35:36.394-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checkbox"/><category scheme="http://www.blogger.com/atom/ns#" term="DHTML"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="removeAttr"/><title type='text'>jQuery - check/uncheck a checkbox</title><content type='html'>&lt;blockquote&gt;    $(&#39;#PrimaryContacts&#39;).unbind().change(function() {&lt;br /&gt;       if ($(&#39;#PrimaryContacts option:selected&#39;).val() == 0) {&lt;br /&gt;           $(&#39;#filterPrimaryContact&#39;)&lt;span style=&quot;font-weight: bold;&quot;&gt;.removeAttr(&#39;checked&#39;)&lt;/span&gt;.trigger(&#39;click&#39;);&lt;br /&gt;       }&lt;br /&gt;       else {&lt;br /&gt;           $(&#39;#filterPrimaryContact&#39;).trigger(&#39;click&#39;);&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   });&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Also, in the example above, triggering the checkbox does not change the checkbox value. As depicted above, based on a dropdown box changing and no contact being selected from the drop down box, automatically uncheck the checkbox and trigger it in invoke any event handlers on the checkbox.</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/539382896927854913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/04/jquery-checkuncheck-checkbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/539382896927854913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/539382896927854913'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/04/jquery-checkuncheck-checkbox.html' title='jQuery - check/uncheck a checkbox'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-1472726076943528928</id><published>2010-03-22T05:12:00.000-07:00</published><updated>2010-03-22T05:50:27.432-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="jscompress"/><title type='text'>jscompress fails to compress my js file and errors out - why?</title><content type='html'>&lt;div class=&quot;post&quot;&gt;&lt;h2&gt;&lt;strong&gt;Issue:&lt;/strong&gt;&lt;/h2&gt; &lt;p&gt;You use the online compression utility jscompress.com to compress  your js file but it fails with an error. Why this may be happening and  how to fix it.&lt;/p&gt; &lt;h2&gt;Possible causes:&lt;/h2&gt; &lt;p&gt;Apparently not using open and closing curly brackets in an IF  statement would cause this. Well turns out this is not the case. Look at  the following example and see if you can figure out what the issue is  :-)&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;function SetupDeliveredVPRecontactNotes($item, id) {&lt;br /&gt;var theData;&lt;br /&gt;&lt;br /&gt;$.ajax({&lt;br /&gt;  data: { deliveredVPId: id },&lt;br /&gt;  url: $(&#39;#ajaxGetDeliveredVPRecontactNotesUrl&#39;).val(),&lt;br /&gt;  type: &quot;GET&quot;,&lt;br /&gt;  async: false,&lt;br /&gt;  dataType: &quot;html&quot;,&lt;br /&gt;  success: function(data, result) {&lt;br /&gt;      $item.empty();&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;var input = &#39;&lt;textarea class=&quot;recontactNote&quot; rows=&quot;4&quot; name=&quot;&#39; + target + &#39;&quot; id=&quot;&#39; + target + &#39;&quot; cols=&quot;115&quot;&gt;&#39; + data + &#39;&lt;/textarea&gt;&#39;;&lt;br /&gt;$item.append(&#39;input&#39;);&lt;br /&gt;      theData = data;&lt;br /&gt;  },&lt;br /&gt;  error: function(XMLHttpRequest, textStatus, errorThrown) {&lt;br /&gt;      $item.empty();&lt;br /&gt;      alert(&quot;An error occurred: The operation to retrieve the &lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; DeliveredVP&#39;s Recontact Notes &lt;/span&gt;has failed&quot;);&lt;br /&gt;  }&lt;br /&gt;});                  //ajax&lt;br /&gt;&lt;br /&gt;return theData;&lt;br /&gt;}&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h2&gt;Solution:&lt;/h2&gt; &lt;p&gt;The issue is the closing textarea tab, concatenate it as &lt;blockquote&gt;&#39;&lt;/&#39; + &#39;textarea&gt;&#39;&lt;/blockquote&gt; will fix the issue&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/1472726076943528928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/03/jscompress-fails-to-compress-my-js-file.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1472726076943528928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/1472726076943528928'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/03/jscompress-fails-to-compress-my-js-file.html' title='jscompress fails to compress my js file and errors out - why?'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-5996079422645847015</id><published>2010-03-15T11:56:00.001-07:00</published><updated>2010-03-15T11:56:58.354-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to check off a checkbox using jQuery</title><content type='html'>$(&#39;#someCheckbox&#39;).attr(&#39;checked&#39;,&#39;true&#39;)</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/5996079422645847015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/03/how-to-check-off-checkbox-using-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5996079422645847015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5996079422645847015'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/03/how-to-check-off-checkbox-using-jquery.html' title='How to check off a checkbox using jQuery'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-5149613952976775983</id><published>2010-02-09T07:43:00.000-08:00</published><updated>2010-02-09T07:48:34.293-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="64-bit"/><title type='text'>How to find out if you are runnig on a 64-bit Processor</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Goal:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Find out if you are runing on a 64-bit processor&lt;/h2&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Answer:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Go to the command prompt (type cmd int the Start -&gt; Search box)&lt;br /&gt;&lt;br /&gt;type the follownig command: set | find &quot;PRECESSOR_ARCHITECTURE&quot;&lt;br /&gt;&lt;br /&gt;If you get ADM64 back (or something similar with 64 in it) you are running on a 64-bit processor, and would be able to install and run for example Windows 7&#39;s 64 bit OS. If you get something like x86 you are running on the older 32-bit architecture.</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/5149613952976775983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2010/02/how-to-find-out-if-you-are-runnig-64.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5149613952976775983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5149613952976775983'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2010/02/how-to-find-out-if-you-are-runnig-64.html' title='How to find out if you are runnig on a 64-bit Processor'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-2048359314242593259</id><published>2009-12-30T05:56:00.001-08:00</published><updated>2009-12-30T06:29:15.952-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net Mvc"/><category scheme="http://www.blogger.com/atom/ns#" term="jqQuery"/><title type='text'>Restructuring ASP.Net MVC app</title><content type='html'>So the issue is, you have a very large ASP.Net MVC app with many controllers and actions and don&#39;t know (or do) on how to restructure it for better maintenance.&lt;br /&gt;&lt;br /&gt;This article contains some thoughts around what my experiences were with building a large scale app with 10K+ lines of jQuery and 266 Actions dispersed over 98 Controllers.&lt;br /&gt;&lt;br /&gt;In the beginning:&lt;br /&gt;&lt;br /&gt;Yes God created .... no I created a relatively small scale Mvc app based on a very limited set of requirements, more like a XP experience or learn as you go. The user community did not know what they wanted and the prototype was based on a missed conception of what the business&#39; core day-to-day focus was (of course we did not know this at the time). There were only a few controllers and they were small.&lt;br /&gt;&lt;br /&gt;Then we discovered the jQuery Grid by Tony Tomov (awesome free plug-in) which supports a ton of ajax features, so we decided to use it for all of our lists and also for a lot of CRUD functions. This very quickly expanded the controllers to a very large size. At this time I decided to not split the controllers as it might introduce bugs. For example an Account has a New, Update, Delete, Create and Edit action, and now it has a List and CUD action (2 actions) added for each grid. Since the Account page has 9 tabs with 13 grids it now has an added 26 actions on that single AccountController controller and then some for other ajax type functions.&lt;br /&gt;&lt;br /&gt;So then very quickly, as the customers saw the app, new requirements were added and the controllers grew even bigger.&lt;br /&gt;&lt;br /&gt;The decision then came as to what to do and how to refactor the code. I ran this past a colleague of mine to find out what he thinks: Large controller with all the logically related actions together (yes all 39 actions at some point) or to split them into smaller but many different controllers? It seemed that keeping it all in one controller was a good decision since when you need to fix something on the account page with all the tabs with grids on them you know you need to go to the AccountController controller, right!? However, what if the requirements change and these grids need to be also displayed in other places, that&#39;s right, like on the Contact&#39;s maintenance page that has the same tabs as the Account page (only filtered by the contact for that account). Now I have a duplicate set of actions that perform essentially an identical function to those on the Account&#39;s controller. That is when it became clear that the controllers&#39; actions should not be arranged according to how the screens look like but to adhere to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Single_responsibility_principle&quot;&gt;SRP&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Lets look at an example. The Account has a list of Calls, Contacts, Contracts and Lessons Learned. Even though these are tabs on the account&#39;s page, they need to be self contained. So this is how they were disseminated and re-arranged to adhere to SRP:&lt;br /&gt;&lt;br /&gt;AccountController: New, Create, Edit, Update, Delete, List actions&lt;br /&gt;CallController: New, Create, Edit, Update, Delete, List actions&lt;br /&gt;ContactController: New, Create, Edit, Update, Delete, List actions&lt;br /&gt;ContractController: New, Create, Edit, Update, Delete, List actions&lt;br /&gt;LLController: New, Create, Edit, Update, Delete, List actions&lt;br /&gt;&lt;br /&gt;The AccountController had a very large constructor since we used IoC Castle Windsor to inject the Repository (DAO type functions) into the constructor; to support all the DAO functions for calls, contacts, contracts and lessons learned. Now the constructor of each controller is very small and only cares about the Repositories it needs. In addition, to mention one example, the Calls tab on the account and contact screens now share the same action defined on another controller specifically to support the jqGrid functions for calls, the CallGridController with its 2 (yes only 2) actions ListCallsForjqGrid() and SaveCallForjqGrid(), rather than duplicating it. Now another developer knows that no matter where the jqGrid is displayed for calls, they can always find it on the CallGridController.&lt;br /&gt;&lt;br /&gt;These are just some of the benefits of creating smaller controllers. Feel free to comment and share your ideas and experiences.</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/2048359314242593259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2009/12/restructuring-aspnet-mvc-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/2048359314242593259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/2048359314242593259'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2009/12/restructuring-aspnet-mvc-app.html' title='Restructuring ASP.Net MVC app'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-3407130145921109544</id><published>2009-10-21T04:55:00.001-07:00</published><updated>2009-10-21T04:55:56.440-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows 7"/><title type='text'>How to set the windows path in Windows 7</title><content type='html'>&lt;table style=&quot;width: 100%;&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;     &lt;tbody&gt;         &lt;tr&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td class=&quot;icell&quot;&gt; &lt;/td&gt;             &lt;td style=&quot;width: 100%;&quot;&gt;&lt;br /&gt;            &lt;table style=&quot;width: 100%;&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;                 &lt;tbody&gt;                     &lt;tr&gt;                         &lt;td style=&quot;width: 80%;&quot; valign=&quot;top&quot;&gt;                         &lt;h1&gt;How to set the path in Windows 7.&lt;/h1&gt;                         &lt;h2&gt;Goal:&lt;/h2&gt;                         &lt;p&gt;Setting the windows command path in Windows 7&lt;/p&gt;                         &lt;h2&gt;Additional information:&lt;/h2&gt;                         &lt;p class=&quot;tab&quot;&gt;Modifying the path statement will enable an MS-DOS window opened in Microsoft Windows as well as older programs to locate files that may be required to run the program.&lt;/p&gt;                         &lt;p class=&quot;tab&quot;&gt;In the old MS-DOS environment we used the PATH= command, located in the autoexec.bat file. Additional information about the MS-DOS path command that is still usable in Windows 2000 and Windows XP can be found on our &lt;a href=&quot;http://www.computerhope.com/pathhlp.htm&quot; _fcksavedurl=&quot;http://www.computerhope.com/pathhlp.htm&quot;&gt;path command page&lt;/a&gt;, additional information about the MS-DOS command can be found on our &lt;a href=&quot;http://www.computerhope.com/sethlp.htm&quot; _fcksavedurl=&quot;http://www.computerhope.com/sethlp.htm&quot;&gt;set command page&lt;/a&gt;.&lt;/p&gt;                         &lt;p class=&quot;tab&quot;&gt;See our &lt;a href=&quot;http://www.computerhope.com/jargon/p/path.htm&quot; _fcksavedurl=&quot;http://www.computerhope.com/jargon/p/path.htm&quot;&gt;dictionary path definition&lt;/a&gt; for additional information about this term and related definitions.&lt;/p&gt;                         &lt;h2&gt;Answer:&lt;/h2&gt;                         &lt;p&gt;The path is now managed by Windows 7 and not the autoexec.bat or autoexec.nt files. To change the system environment variables, follow the below steps. &lt;/p&gt;                         &lt;ol&gt;&lt;li&gt;From the &lt;a href=&quot;http://en.wikipedia.org/wiki/Desktop&quot; _fcksavedurl=&quot;http://en.wikipedia.org/wiki/Desktop&quot;&gt;desktop&lt;/a&gt;, right-click &lt;b&gt;My Computer&lt;/b&gt; and click &lt;b&gt;Properties&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;In the System Properties &lt;a href=&quot;http://en.wikipedia.org/wiki/Windows&quot; _fcksavedurl=&quot;http://en.wikipedia.org/wiki/Windows&quot;&gt;window&lt;/a&gt;, click on the &lt;b&gt;Advanced&lt;/b&gt; &lt;a href=&quot;http://www.computerhope.com/jargon/t/tab.htm&quot; _fcksavedurl=&quot;http://www.computerhope.com/jargon/t/tab.htm&quot;&gt;tab&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;In the Advanced section, click the &lt;b&gt;Environment Variables&lt;/b&gt; &lt;a href=&quot;http://www.computerhope.com/jargon/p/pushbutt.htm&quot; _fcksavedurl=&quot;http://www.computerhope.com/jargon/p/pushbutt.htm&quot;&gt;button&lt;/a&gt;. &lt;/li&gt;&lt;li&gt;Finally, in the Environment Variables window (as shown below), highlight the &lt;b&gt;Path&lt;/b&gt; variable in the Systems Variable section and click the &lt;b&gt;Edit&lt;/b&gt; button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.&lt;br /&gt;                           &lt;br /&gt;                            C:\Program Files;C:\Winnt;C:\Winnt\System32&lt;/li&gt;&lt;/ol&gt;                         &lt;p class=&quot;ce&quot;&gt;&lt;img src=&quot;http://www.computerhope.com/issues/pictures/winpath.jpg&quot; _fcksavedurl=&quot;http://www.computerhope.com/issues/pictures/winpath.jpg&quot; alt=&quot;Windows enviromental path settings&quot; height=&quot;336&quot; width=&quot;300&quot; /&gt;&lt;/p&gt;                         &lt;/td&gt;                     &lt;/tr&gt;                 &lt;/tbody&gt;             &lt;/table&gt;             &lt;/td&gt;         &lt;/tr&gt;     &lt;/tbody&gt; &lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/3407130145921109544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2009/10/how-to-set-windows-path-in-windows-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/3407130145921109544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/3407130145921109544'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2009/10/how-to-set-windows-path-in-windows-7.html' title='How to set the windows path in Windows 7'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-5486693351452627045</id><published>2009-10-09T11:00:00.000-07:00</published><updated>2009-10-09T11:01:29.463-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="32-bit"/><category scheme="http://www.blogger.com/atom/ns#" term="64-bit"/><category scheme="http://www.blogger.com/atom/ns#" term="CPU"/><category scheme="http://www.blogger.com/atom/ns#" term="x8086"/><title type='text'>Do I have a 64-bit or 32-bit CPU (Processor)?</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;How to check what kind of processor you have (CPU) and what operating system can I run on it?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An X64 has a 64 bit microprocessor, whereas an X86, derived from the old 8086 PC, has a 32 bit microprocessor. A 32 bit machine and/or OS (operating system) is limited to about 3.55GB of memory, and an X64 is limited to about 17,179,869,184 gigabytes, 17,179,869 terabytes, or about 16 exabytes of RAM. Also a 32-bit OS cannot run an 64-bit OS.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;So, how to check your CPU:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since you cannot run WIndows7-64x on a 32-bit machine lets look at windows 7.  From the Start icon on the toolbar select Control Panel. Look for Hardware and SOund and select View devices and printers. Double-click yur computer (will be labeled with your machine name). A Properties window pops-up with two tabs, select the Hardware tab. Look for a name starting with ACPI, with Type of Computer. If it says ACPI x64-based PC you know you have a 64-bit machine, CONGRATULATIONS! You can now install a 64-bit OS like Vista-64 or Windows7-64 and run any of your old software as the new 64-bit OS &quot;knows&quot; (is compatible) how to run the 32-bit apps.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What about memory? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you want to install more than 4GB or RAM you will need to have a 64-bit CPU and also run a 64-bit OS otherwise you are wasting your money.</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/5486693351452627045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2009/10/do-i-have-64-bit-or-32-bit-cpu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5486693351452627045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5486693351452627045'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2009/10/do-i-have-64-bit-or-32-bit-cpu.html' title='Do I have a 64-bit or 32-bit CPU (Processor)?'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7678508354561484071.post-5663744671971478501</id><published>2009-09-21T15:05:00.000-07:00</published><updated>2009-09-21T15:08:26.306-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to stop and prompt user when closing browser</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Scenario: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;For some reason you want to stop the user from closing the browser window or from redirecting away from the current page, based on some condition.&lt;/h3&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; window.onbeforeunload = function(event) {&lt;br /&gt;           return true;&lt;br /&gt;       }&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This will prompt you for input (like the JavaScript confirm pop-up menu). There is no way to override the text though.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Some concerns:&lt;/span&gt;&lt;br /&gt;This works great but it may not be what you want all the time, as no matter if you click a hyperlink, hit submit, etc will prompt the user. So here is an example where only when any input value on the screen has changed, I want to prompt the user only then and also only if the user decides to redirect from the page. It should not prompt the user when I try and save/delete or update the page:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;var dataUpdated = false;&lt;br /&gt;&lt;br /&gt;$(document).ready(function() {&lt;br /&gt;   &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;SetupChangeEventOnAllInputElementsAndSetGlobalFlag&lt;/span&gt;();&lt;br /&gt;})&lt;br /&gt;&lt;br /&gt;function &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;SetupChangeEventOnAllInputElementsAndSetGlobalFlag&lt;/span&gt;() {&lt;br /&gt;   $(&#39;:input&#39;).change(function() {&lt;br /&gt;       dataUpdated = true;&lt;br /&gt;&lt;br /&gt;       window.onbeforeunload = function(evt) {&lt;br /&gt;&lt;br /&gt;           var e = e || window.event;&lt;br /&gt;&lt;br /&gt;           // For IE and Firefox&lt;br /&gt;           if (e) {&lt;br /&gt;               if (DetermineSubmit(evt) == true)&lt;br /&gt;                   return;&lt;br /&gt;               else&lt;br /&gt;                   e.returnValue = &#39;You have not saved your changes - OK to ignore or Cancel to remain on this page?&#39;;&lt;br /&gt;           }&lt;br /&gt;           else {&lt;br /&gt;               // For Safari&lt;br /&gt;               if (&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;DetermineSubmit&lt;/span&gt;(evt) == true)&lt;br /&gt;                   return&lt;br /&gt;               else&lt;br /&gt;                   return &#39;You have not saved your changes - OK to ignore or Cancel to remain on this page?&#39;;&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   });&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Determine if the original event is a submit button/control that triggered the window unload&lt;br /&gt;function &lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;DetermineSubmit&lt;/span&gt;(evt) {&lt;br /&gt;   if ($(evt.explicitOriginalTarget).is(&#39;:submit&#39;)) {&lt;br /&gt;       return true;&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   return false;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://rensodevelopment.blogspot.com/feeds/5663744671971478501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rensodevelopment.blogspot.com/2009/09/how-to-stop-and-prompt-user-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5663744671971478501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7678508354561484071/posts/default/5663744671971478501'/><link rel='alternate' type='text/html' href='http://rensodevelopment.blogspot.com/2009/09/how-to-stop-and-prompt-user-when.html' title='How to stop and prompt user when closing browser'/><author><name>Renso</name><uri>http://www.blogger.com/profile/01639151785438207866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>