<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Focus not working</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/focus-not-working</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/focus-not-working/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jmoran888 on Focus not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/focus-not-working#p19196</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/focus-not-working#p19196</guid>
        	        	<description><![CDATA[<p>I have a grid which launches a custom add dialog.&#160; On the add dialog I have another grid.&#160; When I click on that add dialog (just the default one), only my first select box is available for input/selection.&#160; I have two additional text fields which I cannot input anything into or even get focus to even though I am setting editable to true</p>
<p>&#60;%@ taglib uri="/struts-tags" prefix="s"%&#62;</p>
<p>&#60;table id="main"&#62;&#60;/table&#62;</p>
<p>&#60;div id="pager"&#62;&#60;/div&#62;</p>
<p>&#60;script language = "JavaScript"</p>
<p>type = "text/JavaScript" &#62;</p>
<p>function initPage() {</p>
<p>$(&#39;#formBlock&#39;).dialog({</p>
<p>autoOpen: false,</p>
<p>modal: true,</p>
<p>title: &#39;Add Booking&#39;</p>
<p>});</p>
<p>var colnames = new Array(&#39;&#60;s:text name="id"/&#62;&#39;, &#39;&#60;s:text name="booking"/&#62;&#39;, &#39;&#60;s:text name="ssl"/&#62;&#39;, &#39;&#60;s:text name="bookingType"/&#62;&#39;, &#39;&#60;s:text name="equipmentType"/&#62;&#39;, &#39;&#60;s:text name="vessel"/&#62;&#39;, &#39;&#60;s:text name="voyage"/&#62;&#39;, &#39;&#60;s:text name="portLoading"/&#62;&#39;, &#39;&#60;s:text name="authorizations"/&#62;&#39;, &#39;&#60;s:text name="hazards"/&#62;&#39;, &#39;&#60;s:text name="specials"/&#62;&#39;, &#39;&#60;s:text name="createdDate"/&#62;&#39;, &#39;&#60;s:text name="modifiedDate"/&#62;&#39;);</p>
<p>jQuery(&#39;#main&#39;).jqGrid({</p>
<p>sortable: true,</p>
<p>width: 1200,</p>
<p>height: 425,</p>
<p>url: &#39;BookAction_data&#39;,</p>
<p>datatype: &#39;json&#39;,</p>
<p>colNames: colnames,</p>
<p>//[&#39;Id&#39;,&#39;Booking&#39;,&#39;SSL&#39;,&#39;Booking Type&#39;,&#39;Equipment Type&#39;,&#39;Vessel&#39;,&#39;Voyage&#39;,&#39;Port&#39;,&#39;Authorizations&#39;,&#39;Hazards&#39;,&#39;Specials&#39;,&#39;Created Date&#39;,&#39;Modified Date&#39;],</p>
<p>colModel: [{</p>
<p>name: &#39;bookingId&#39;,</p>
<p>index: &#39;bookingId&#39;,</p>
<p>width: 100,</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;booking&#39;,</p>
<p>index: &#39;booking&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 20</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;ssl&#39;,</p>
<p>index: &#39;ssl&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 30</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;bookingtype&#39;,</p>
<p>index: &#39;bookingtype&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;equipmenttype&#39;,</p>
<p>index: &#39;equipmenttype&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;vessel&#39;,</p>
<p>index: &#39;vessel&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 30</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;voyage&#39;,</p>
<p>index: &#39;voyage&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;port&#39;,</p>
<p>index: &#39;port&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 30</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;authorizations&#39;,</p>
<p>index: &#39;authorizations&#39;,</p>
<p>width: 100,</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;hazards&#39;,</p>
<p>index: &#39;hazards&#39;,</p>
<p>width: 100,</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;specials&#39;,</p>
<p>index: &#39;specials&#39;,</p>
<p>width: 100,</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;createddate&#39;,</p>
<p>index: &#39;createddate&#39;,</p>
<p>width: 100,</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;modifieddate&#39;,</p>
<p>index: &#39;modifieddate&#39;,</p>
<p>width: 100,</p>
<p>sorttype: &#39;date&#39;,</p>
<p>formatter: &#39;date&#39;,</p>
<p>formatoptions: {</p>
<p>srcformat: &#39;UniversalSortableDateTime&#39;,</p>
<p>newformat: &#39;ISO8601Long&#39;</p>
<p>},</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>}],</p>
<p>rownumbers: true,</p>
<p>rowNum: 20,</p>
<p>loadonce: true,</p>
<p>gridview: true,</p>
<p>//rowList:[20,100,200],</p>
<p>sortname: &#39;booking&#39;,</p>
<p>sortorder: &#39;desc&#39;,</p>
<p>pager: &#39;#pager&#39;,</p>
<p>viewrecords: true,</p>
<p>caption: &#39;Bookings&#39;</p>
<p>});</p>
<p>jQuery(&#39;#main&#39;).jqGrid(&#39;navGrid&#39;, &#39;#pager&#39;, {</p>
<p>add: false,</p>
<p>view: true</p>
<p>}, //options</p>
<p>{}, // edit options</p>
<p>// {}, // add options</p>
<p>{</p>
<p>reloadAfterSubmit: false</p>
<p>}, // del options</p>
<p>{</p>
<p>multipleSearch: true</p>
<p>}, // search options</p>
<p>{</p>
<p>height: &#39;auto&#39;,</p>
<p>width: &#39;auto&#39;,</p>
<p>jqModal: false,</p>
<p>closeOnEscape: true</p>
<p>} // view options</p>
<p>);</p>
<p>jQuery(&#39;#main&#39;).jqGrid(&#39;navButtonAdd&#39;, &#39;#pager&#39;, {</p>
<p>caption: &#39;Columns&#39;,</p>
<p>title: &#39;Reorder Columns&#39;,</p>
<p>onClickButton: function () {</p>
<p>//jQuery(&#39;#main&#39;).jqGrid(&#39;columnChooser&#39;);</p>
<p>jQuery("#main").jqGrid(&#39;setColumns&#39;);</p>
<p>}</p>
<p>});</p>
<p>jQuery(&#39;#main&#39;).jqGrid(&#39;navButtonAdd&#39;, &#39;#pager&#39;, {</p>
<p>caption: &#39;Add&#39;,</p>
<p>title: &#39;Add Record&#39;,</p>
<p>onClickButton: function () {</p>
<p>function DisplayEmptyText( display)</p>
<p>{</p>
<p>var grid = $(&#39;#items&#39;);</p>
<p>var emptyText = grid.getGridParam(&#39;emptyDataText&#39;); // get the empty text</p>
<p>var container = grid.parents(&#39;.ui-jqgrid-view&#39;); // find the grid&#39;s container</p>
<p>if (display) {</p>
<p>container.find(&#39;.ui-jqgrid-hdiv, .ui-jqgrid-bdiv&#39;).hide(); // hide the column headers and the cells below</p>
<p>container.find(&#39;.ui-jqgrid-titlebar&#39;).after(&#39;&#39; + emptyText + &#39;&#39;); // insert the empty data text</p>
<p>}</p>
<p>else {</p>
<p>container.find(&#39;.ui-jqgrid-hdiv, .ui-jqgrid-bdiv&#39;).show(); // show the column headers</p>
<p>container.find(&#39;#EmptyData&#39; + dataObject).remove(); // remove the empty data text</p>
<p>}</p>
<p>};</p>
</p>
<p>var itemcolnames = new Array(&#39;&#60;s:text name="id"/&#62;&#39;, &#39;&#60;s:text name="equipmentType"/&#62;&#39;, &#39;&#60;s:text name="quantity"/&#62;&#39;, &#39;&#60;s:text name="reeferStatus"/&#62;&#39;);</p>
<p>jQuery(&#39;#items&#39;).jqGrid({</p>
<p>sortable: true,</p>
<p>width: 665,</p>
<p>autoheight: true,</p>
<p>resizable: true,</p>
<p>url: &#39;BookAction_itemdata&#39;,</p>
<p>datatype: &#39;json&#39;,</p>
<p>colNames: itemcolnames,</p>
<p>//[&#39;Id&#39;,&#39;Booking&#39;,&#39;SSL&#39;,&#39;Booking Type&#39;,&#39;Equipment Type&#39;,&#39;Vessel&#39;,&#39;Voyage&#39;,&#39;Port&#39;,&#39;Authorizations&#39;,&#39;Hazards&#39;,&#39;Specials&#39;,&#39;Created Date&#39;,&#39;Modified Date&#39;],</p>
<p>colModel: [{</p>
<p>name: &#39;lhtId&#39;,</p>
<p>index: &#39;lhtId&#39;,</p>
<p>width: 100,</p>
<p>editable: false,</p>
<p>editoptions: {</p>
<p>readonly: true,</p>
<p>size: 10</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;lhtCode&#39;,</p>
<p>index: &#39;lhtCode&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>edittype: &#39;select&#39;,</p>
<p>editoptions: {</p>
<p>dataUrl: "BookAction_itemlist"</p>
<p>}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;quantity&#39;,</p>
<p>index: &#39;quantity&#39;,</p>
<p>width: 100,</p>
<p>sorttype: &#39;int&#39;,</p>
<p>editable: true,</p>
<p>edittype: &#39;text&#39;,</p>
<p>editoptions: {</p>
<p>maxlength: 10,</p>
<p>size: 30</p>
<p>},</p>
<p>editrules:{required:true, integer: true, minValue: &#39;1&#39;}</p>
<p>},</p>
<p>{</p>
<p>name: &#39;reeferType&#39;,</p>
<p>index: &#39;reeferType&#39;,</p>
<p>width: 100,</p>
<p>editable: true,</p>
<p>editoptions: {</p>
<p>size: 10</p>
<p>}</p>
<p>}],</p>
<p>rownumbers: true,</p>
<p>rowNum: 10,</p>
<p>loadonce: true,</p>
<p>gridview: true,</p>
<p>rowList: [10, 20, 30],</p>
<p>sortname: &#39;lhtCode&#39;,</p>
<p>sortorder: &#39;desc&#39;,</p>
<p>viewrecords: true,</p>
<p>pager: &#39;#itempager&#39;,</p>
<p>caption: &#39;Items&#39;,</p>
<p>loadComplete: function(){</p>
<p>if($(&#39;#items&#39;).getGridParam("reccount")==0) {</p>
<p>DisplayEmptyText(true);</p>
<p>}</p>
<p>else{</p>
<p>DisplayEmptyText(false);</p>
<p>}},</p>
<p>emptyDataText:&#39;There are no records. If you would like to add one, click the "Add New ..." button below.&#39;,</p>
<p>editurl:"someurl.php"</p>
<p>});</p>
<p>jQuery(&#39;#items&#39;).jqGrid(&#39;navGrid&#39;, &#39;#itempager&#39;, {</p>
<p>}, {</p>
<p>reloadAfterSubmit: false</p>
<p>}, // edit options</p>
<p>{</p>
<p>reloadAfterSubmit: false</p>
<p>}, // add options</p>
<p>{</p>
<p>reloadAfterSubmit: false</p>
<p>}, // del options</p>
<p>{}); //options</p>
</p>
<p>$("#formBlock").dialog("option", "height", 530);</p>
<p>$("#formBlock").dialog("option", "width", 750);</p>
<p>$(&#39;#formBlock&#39;).dialog("open");</p>
<p>}</p>
<p>});</p>
<p>}</p>
<p>&#60;/script&#62;</p>
<p>&#60;div id="formBlock"&#62;&#60;s:form action="Book_save"&#62;</p>
<p>&#60;fieldset&#62;&#60;legend&#62; &#60;s:text name="booking" /&#62; &#60;/legend&#62; &#60;label&#62;</p>
<p>&#60;s:text name="booking" /&#62; &#60;/label&#62; &#60;s:textfield name="booking" maxlength="30"</p>
<p>required="true" /&#62; &#60;label&#62; &#60;s:text name="ssl" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="ssl" name="sslCode" list="#request.ssls" listKey="sslCode"</p>
<p>listValue="sslDescription" required="true" multiple="false" /&#62; &#60;br /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="bookingType" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="bookingType" required="true" multiple="false"</p>
<p>name="bookingType"</p>
<p>list="#{&#39;N&#39;:&#39;Normal&#39;,&#39;P&#39;:&#39;Positioning&#39;,&#39;T&#39;:&#39;Terminating&#39;, &#39;X&#39; : &#39;Export Only&#39;}" /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="equipmentType" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="equipmentType" required="true" multiple="false"</p>
<p>name="equipmentType" list="#{&#39;C&#39;:&#39;Container&#39;,&#39;H&#39;:&#39;Chassis&#39;}" /&#62;&#60;/fieldset&#62;</p>
<p>&#60;fieldset&#62;&#60;legend&#62; &#60;s:text name="routing" /&#62; &#60;/legend&#62; &#60;label&#62;</p>
<p>&#60;s:text name="vessel" /&#62; &#60;/label&#62; &#60;s:select label="vessel" name="vesselCode"</p>
<p>list="#request.vessels" listKey="code" listValue="longDescription"</p>
<p>required="true" multiple="false" /&#62; &#60;label&#62; &#60;s:text</p>
<p>name="voyage" /&#62; &#60;/label&#62; &#60;s:textfield name="voyage" maxlength="10"</p>
<p>required="true" /&#62; &#60;br /&#62;</p>
<p>&#60;br /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="portOfDispatch" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="portOfDispatch" name="portOfDispatch" list="#request.ports"</p>
<p>listKey="code" listValue="display" required="true" multiple="false" /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="portOfLoading" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="portOfLoading" name="portOfLoading" list="#request.ports"</p>
<p>listKey="code" listValue="display" required="true" multiple="false" /&#62;</p>
<p>&#60;br /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="portOfDischarge" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="portOfDischarge" name="portOfDischarge" list="#request.ports"</p>
<p>listKey="code" listValue="display" required="true" multiple="false" /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="portOfDestination" /&#62; &#60;/label&#62; &#60;s:select</p>
<p>label="portOfDestination" name="portOfDestination"</p>
<p>list="#request.ports" listKey="code" listValue="display"</p>
<p>required="true" multiple="false" /&#62; &#60;br /&#62;</p>
<p>&#60;br /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="shipper" /&#62; &#60;/label&#62; &#60;s:textfield name="shipper"</p>
<p>maxlength="60" required="true" /&#62; &#60;label&#62; &#60;s:text</p>
<p>name="trucker" /&#62; &#60;/label&#62; &#60;s:textfield name="trucker" maxlength="30"</p>
<p>required="true" /&#62; &#60;br /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="consignee" /&#62; &#60;/label&#62; &#60;s:textfield</p>
<p>name="consignee" maxlength="60" required="true" /&#62; &#60;label&#62; &#60;s:text</p>
<p>name="commodity" /&#62; &#60;/label&#62; &#60;s:textfield name="commodity" maxlength="50"</p>
<p>required="true" /&#62; &#60;br /&#62;</p>
<p>&#60;label&#62; &#60;s:text name="remarks" /&#62; &#60;/label&#62; &#60;s:textfield name="remarks"</p>
<p>maxlength="60" required="true" /&#62;&#60;/fieldset&#62;</p>
<p>&#60;fieldset&#62;&#60;legend&#62; &#60;s:text name="items" /&#62; &#60;/legend&#62;</p>
<p>&#60;table id="items"&#62;&#60;/table&#62;</p>
<p>&#60;div id="itempager"&#62;</p>
<p>&#60;/div&#62;</p>
<p>&#60;/fieldset&#62;</p>
<p>&#60;/s:form&#62;&#60;/div&#62;</p>
</p>
<p>Also - how do I post code so it is formatted and readable?</p>
</p>
<p>Any help is appreciated.</p>
</p>
<p>thanks,</p>
</p>
<p>Jmoran888</p>
]]></description>
        	        	<pubDate>Wed, 18 Aug 2010 19:24:20 +0300</pubDate>
        </item>
</channel>
</rss>