<?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: Sorting is not working after frozen columns implemented</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented</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/discussion/sorting-is-not-working-after-frozen-columns-implemented/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Sorting is not working after frozen columns implemented</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented#p31088</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented#p31088</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>Simple to sayyourcode is complex and very difficult to beanalyzed.</p>
<p>Try withsimple code on which we can operate.</p>
<p>Â </p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 08 Sep 2014 14:35:45 +0300</pubDate>
        </item>
        <item>
        	<title>gdp507 on Sorting is not working after frozen columns implemented</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented#p31056</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented#p31056</guid>
        	        	<description><![CDATA[<p>Can any one know why sorting is not working after frozen columns functionality implemented?</p>
<p>Please reply back if any one has answer/solution.</p>
]]></description>
        	        	<pubDate>Thu, 04 Sep 2014 19:23:10 +0300</pubDate>
        </item>
        <item>
        	<title>gdp507 on Sorting is not working after frozen columns implemented</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented#p31054</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/sorting-is-not-working-after-frozen-columns-implemented#p31054</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I am using tabletogrid approach to load the jqgrid. In this sorting, searching and Resize is working perfectly with my code changes.</p>
<p>I tried to incorporate the freeze column functionality for the first 3 columns, after implemented this functionality sorting is not working completely and when Resize columns headers alignment is missing. Also filter also not working for first time of freeze columns.</p>
<p>Below is my code can you help me on this.Â </p>
<p>this.turnTableToGrid = function(){<br />
 var that = this;</p>
<p>//Frozen column code -- Note after frozen sorting is not working<br />
 var $grid = $("#"+that.mainGridId),</p>
<p>resizeColumnHeader = function () {<br />
 var rowHight, resizeSpanHeight,<br />
 // get the header row which contains<br />
 headerRow = $(this).closest("div.ui-jqgrid-view")<br />
 .find("table.ui-jqgrid-htable&#62;thead&#62;tr.ui-jqgrid-labels");</p>
<p>// reset column height<br />
 headerRow.find("span.ui-jqgrid-resize").each(function () {<br />
 this.style.height = '';<br />
 });</p>
<p>// increase the height of the resizing span<br />
 resizeSpanHeight = 'height: ' + headerRow.height() + 'px !important; cursor: col-resize;';<br />
 headerRow.find("span.ui-jqgrid-resize").each(function () {<br />
 this.style.cssText = resizeSpanHeight;<br />
 });</p>
<p>// set position of the dive with the column header text to the middle<br />
 rowHight = headerRow.height();<br />
 headerRow.find("div.ui-jqgrid-sortable").each(function () {<br />
 var ts = $(this);<br />
 ts.css('top', (rowHight - ts.outerHeight()) / 2 + 'px');<br />
 });<br />
 },<br />
 fixPositionsOfFrozenDivs = function () {<br />
 var $rows;<br />
 if (typeof this.grid.fbDiv !== "undefined") {<br />
 $rows = $('&#62;div&#62;table.ui-jqgrid-btable&#62;tbody&#62;tr', this.grid.bDiv);<br />
 $('&#62;table.ui-jqgrid-btable&#62;tbody&#62;tr', this.grid.fbDiv).each(function (i) {<br />
 var rowHight = $($rows[i]).height(), rowHightFrozen = $(this).height();<br />
 if ($(this).hasClass("jqgrow")) {<br />
 $(this).height(rowHight);<br />
 rowHightFrozen = $(this).height();<br />
 if (rowHight !== rowHightFrozen) {<br />
 $(this).height(rowHight + (rowHight - rowHightFrozen));<br />
 }<br />
 }<br />
 });<br />
 $(this.grid.fbDiv).height(this.grid.bDiv.clientHeight);<br />
 $(this.grid.fbDiv).css($(this.grid.bDiv).position());<br />
 }<br />
 if (typeof this.grid.fhDiv !== "undefined") {<br />
 $rows = $('&#62;div&#62;table.ui-jqgrid-htable&#62;thead&#62;tr', this.grid.hDiv);<br />
 $('&#62;table.ui-jqgrid-htable&#62;thead&#62;tr', this.grid.fhDiv).each(function (i) {<br />
 var rowHight = $($rows[i]).height(), rowHightFrozen = $(this).height();<br />
 $(this).height(rowHight);<br />
 rowHightFrozen = $(this).height();<br />
 if (rowHight !== rowHightFrozen) {<br />
 $(this).height(rowHight + (rowHight - rowHightFrozen));<br />
 }<br />
 });<br />
 $(this.grid.fhDiv).height(this.grid.hDiv.clientHeight);<br />
 $(this.grid.fhDiv).css($(this.grid.hDiv).position());<br />
 }<br />
 },<br />
 fixGboxHeight = function () {<br />
 var gviewHeight = $("#gview_" + $.jgrid.jqID(this.id)).outerHeight(),<br />
 pagerHeight = $(this.p.pager).outerHeight();</p>
<p>$("#gbox_" + $.jgrid.jqID(this.id)).height(gviewHeight + pagerHeight);<br />
 gviewHeight = $("#gview_" + $.jgrid.jqID(this.id)).outerHeight();<br />
 pagerHeight = $(this.p.pager).outerHeight();<br />
 $("#gbox_" + $.jgrid.jqID(this.id)).height(gviewHeight + pagerHeight);<br />
 };</p>
<p>var checkboxHeader = '&#60;label onclick="releaseDateResultProcessorObject.selectAllSelectorCheckboxes(event)" style="margin-top: -5px;"&#62;&#60;input type="checkbox" class="ace" id="checkAll_checkbox"/&#62;&#60;span class="lbl"&#62;&#60;/span&#62;&#60;/label&#62;';<br />
 var dragHandle = '&#60;i class="icon-move" data-rel="tooltip" title="Drag To Move" data-placement="right"&#62;&#60;/i&#62;';<br />
 var options = {<br />
 datatype:'local',<br />
 width:"1360",<br />
 height: "100%",<br />
 shrinkToFit: false,<br />
 rownumbers: false,<br />
 gridview: true,<br />
 multiSort: true,<br />
 sortname: "Id",<br />
 sortorder: "asc",<br />
 viewrecords: true,<br />
 loadui: true,<br />
 ignoreCase:true,<br />
 // loadonce: true, -- since it's of no use since we are using tableToGrid approach..<br />
 multiselect:false,<br />
 rowNum : 10000,<br />
 deepempty : true,<br />
 sortable: false,<br />
 resizeStop: function () {<br />
 resizeColumnHeader.call(this);<br />
 fixPositionsOfFrozenDivs.call(this);<br />
 fixGboxHeight.call(this);<br />
 /*if($('#gbox_rdr_tableToGrid .ui-search-toolbar').is(":visible")) {<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").css({"line-height": "4px"});<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find('.ui-search-toolbar').removeAttr('style');<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find('.ui-jqgrid-labels').css({"height": "44px"});<br />
 } else {<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").css({"line-height": "4px"});<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find('.ui-search-toolbar').css({"height": "1px"});<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find('.ui-jqgrid-labels').css({"height": "56px"});<br />
 }*/<br />
 },<br />
 loadComplete: function() {<br />
 that.checkNotesExisted();<br />
 $('#'+that.mainGridId +' tr').each(function (index,trElem){<br />
 $(trElem).attr('id',index);<br />
 });<br />
 that.lastSel = null;<br />
 if(that.editMode){<br />
 /*$('#' + that.mainGridId + ' .date-picker-noImage').datepicker("destroy");<br />
 $('#' + that.mainGridId + ' .date-picker-noImage').datepicker({format: "dd-M-yyyy", forceParse: false,autoclose:true}).on('changeDate', function (ev) {<br />
 $(this).datepicker('hide');<br />
 });*/<br />
 that.onLoadCheckForInlineEdit();<br />
 that.datePickerRDFocusOut();<br />
 }</p>
<p>var recordCount = $(this).jqGrid('getGridParam', 'records');<br />
 if(recordCount &#62; 0) {<br />
 $('#rdrCountInfo').removeClass('hide');<br />
 $('#rdr-count').html(recordCount);<br />
 } else {<br />
 $('#rdrCountInfo').addClass('hide');<br />
 }</p>
<p>var show = (releaseDateResultProcessorObject.editMode == false ? 'disabled="disabled"' : '');<br />
 var checkboxHeader = '&#60;label onclick="releaseDateResultProcessorObject.selectAllSelectorCheckboxes(event)" style="margin-top: -5px;"&#62;&#60;input type="checkbox" ' + show + ' class="ace" id="checkAll_checkbox"/&#62;&#60;span class="lbl"&#62;&#60;/span&#62;&#60;/label&#62;';<br />
 var checkBoxHeaderId = "rdr_checkboxHeader";<br />
 $('.frozen-div.ui-state-default.ui-jqgrid-hdiv').find("#jqgh_"+that.mainGridId+"_"+checkBoxHeaderId).html(checkboxHeader);<br />
 $('.ui-state-default.ui-jqgrid-hdiv').find("#jqgh_"+that.mainGridId+"_"+checkBoxHeaderId).html(checkboxHeader);</p>
<p>//$(".frozen-div.ui-state-default.ui-jqgrid-hdiv").css({"position": "absolute", "left": "0px", "top": "1px"});<br />
 //$(".frozen-bdiv.ui-jqgrid-bdiv").css({"overflow-y": "hidden", "height": "383px", "background": "white", "top": "32px", "overflow": "hidden", "border-right": "1px solid #d3d3d3"});</p>
<p>//Frozen column code<br />
 fixPositionsOfFrozenDivs.call(this);<br />
 if($('#gbox_rdr_tableToGrid .ui-search-toolbar').is(":visible")) {<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").css({"line-height": "17px"});<br />
 /*$('#gbox_rdr_tableToGrid').find(".frozen-bdiv.ui-jqgrid-bdiv").css({"top": "1px"});<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find(".ui-jqgrid-htable .ui-jqgrid-labels").css({"height": "32px"});*/<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find('.ui-search-toolbar').removeAttr('style');<br />
 } else {<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").css({"line-height": "4px"});<br />
 // $('#gbox_rdr_tableToGrid').find(".frozen-bdiv.ui-jqgrid-bdiv").css({"top": "101px"});<br />
 // $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find(".ui-jqgrid-htable .ui-jqgrid-labels").css({"height": "56px"});<br />
 $('#gbox_rdr_tableToGrid').find(".frozen-div.ui-state-default.ui-jqgrid-hdiv").find('.ui-search-toolbar').css({"height": "1px"});<br />
 }<br />
 },<br />
 //colName: [checkboxHeader,dragHandle,'Description', 'Media', 'Source Type', 'Source', 'Auto Firm', 'Auto Firm Period','', '', '', '', '', '', ''],<br />
 /*colName: [checkboxHeader,'Title','Fin Prod ID', 'Product Type', 'Title Tags', 'Date Type', 'Territory','Language', 'Release Date', 'Rel Date Status', 'Feed Date', 'Feed Date Status', 'Manual Date',<br />
 'Temp/Perm','Projected Date','Rel Date Tags','','','','','','','','','','','','','','','','',''],// count is 33</p>
<p>searchoptions is as follows..<br />
 sopt : ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']<br />
 The corresponding texts are in language file and mean the following:<br />
 ['equal','not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'] */<br />
 colModel: [{name: 'rdr_checkboxHeader',editable: false, width:30, align:'center', sortable:false, formatter:that.rowSelectorFormatter,resizable: false,search:false, frozen: true },<br />
 {name: 'rdr_icon',width:105,editable: false, sortable:false, formatter:that.iconFormatter,resizable: false,search:false, frozen: true },<br />
 {name: 'rdr_titleName',editable: false, sortable:true, width:190,searchoptions: { sopt: ['cn', 'eq','bw']}, frozen: true },<br />
 {name: 'rdr_fnnclPrdctId', editable: false, sortable:true, width:95,searchoptions: { sopt: ['cn', 'eq','bw']}},<br />
 {name: 'rdr_productType', editable: false, width:110,searchoptions: { sopt: ['cn', 'eq','bw']}},<br />
 {name: 'rdr_titleTags', editable: false, width:90,searchoptions: { sopt: ['cn', 'eq','bw']}},<br />
 {name: 'rdr_dateType', editable: false, width:90,searchoptions: { sopt: ['cn', 'eq','bw']}},<br />
 {name: 'rdr_territory', editable: false, width:170,searchoptions: { sopt: ['cn', 'eq','bw']}},<br />
 {name: 'rdr_language', width:90, editable:false,searchoptions: { sopt: ['cn', 'eq','bw']}},<br />
 {name: 'rdr_releaseDate', width:110, editable:false, sorttype:'date', datefmt:'Y-m-d', searchrules:{date:true}, formatter:that.releaseDateFormatter,<br />
 searchoptions: { sopt: ['eq','lt','gt','ne'], dataInit: that.initDateSearch }<br />
 },<br />
 {name: 'rdr_relDateStatus', width:170, editable:false,formatter:that.relDateStatusFormatter/*,searchoptions: { sopt: ['cn', 'eq','bw']}*/,title:false},<br />
 {name: 'rdr_feedDate', index: 'rdr_feedDate', width:105, editable:false, sorttype:'date', datefmt:'Y-m-d', searchrules:{date:true}, formatter:that.feedDateFormatter,<br />
 searchoptions: { sopt: ['eq','lt','gt','ne'], dataInit: that.initDateSearch }<br />
 },<br />
 {name: 'rdr_feedDateStatus', width:140, editable:true,searchoptions: { sopt: ['cn', 'eq','bw']},title:false},<br />
 /*{name: 'rdr_manualDate', width:90, editable:false, sorttype:'date', datefmt:'Y-m-d', formatter:that.manualDateFormatter,searchoptions: { sopt: ['cn', 'eq','bw']},searchrules:{date:true},clearSearch : true,dataInit : function (elem) {<br />
 $(elem).datepicker({format: "dd-M-yyyy", forceParse: false,autoclose:true});<br />
 } },*/<br />
 {name: 'rdr_manualDate', index: 'rdr_manualDate', width:105, editable:false, sorttype:'date', datefmt:'Y-m-d', searchrules:{date:true}, formatter:that.manualDateFormatter,<br />
 searchoptions: { sopt: ['eq','lt','gt','ne'], dataInit: that.initDateSearch }<br />
 },<br />
 {name: 'rdr_tempPerm', index: 'rdr_tempPerm', width:170, editable:false, formatter:that.tempPermFormatter, title:false//stype: 'select',<br />
 //sorttype: function(cell) {return categories[cell];},<br />
 //searchoptions: { sopt:['eq'], value: ':Any;1:Permanent;2:Temporary' } /*,searchoptions: { sopt: ['cn', 'eq','bw']}*/<br />
 },<br />
 {name: 'rdr_projectedDate', index: 'rdr_projectedDate', width:125, editable:false, sorttype:'date', datefmt:'Y-m-d', searchrules:{date:true}, formatter:that.projectedDateFormatter,<br />
 searchoptions: { sopt: ['eq','lt','gt','ne'], dataInit: that.initDateSearch }<br />
 },<br />
 {name: 'rdr_relDateTags', width:170, editable:true,formatter:that.releaseDateTagsFormatter/*relDateTagFormatter,searchoptions: { sopt: ['cn', 'eq','bw']}*/,title:false},</p>
<p>{name: 'rdr_createDate', hidden:true, editable:false, key:true},<br />
 {name: 'rdr_updateDate', hidden:true, editable:false},<br />
 {name: 'rdr_createName', hidden:true, editable:false},<br />
 {name: 'rdr_updateName', hidden:true, editable:false},<br />
 {name: 'rdr_releaseDateId', hidden:true, editable:false},<br />
 {name: 'rdr_comments', hidden:true, editable:false},<br />
 {name: 'rdr_productId', hidden:true, editable:false},<br />
 {name: 'rdr_releaseDateGuidelineId', hidden:true, editable:false},<br />
 {name: 'rdr_dateSourceId', hidden:true, editable:false},</p>
<p>{name: 'rdr_productVersionId', hidden:true, editable:false},<br />
 {name: 'rdr_admissions', hidden:true, editable:false},<br />
 {name: 'rdr_boxOfficeAmountLc', hidden:true, editable:false},<br />
 {name: 'rdr_boxOfficeAmountUsd', hidden:true, editable:false},<br />
 {name: 'rdr_compareString', hidden:true, editable:false},<br />
 {name: 'rdr_versionId', hidden:true, editable:false},<br />
 {name: 'rdr_intlPrdTypeId', hidden:true, editable:false},<br />
 {name: 'rdr_relaseDateTags', hidden:true, editable:false},<br />
 {name: 'rdr_affectedWindowFlag', hidden:true, editable:false},<br />
 {name: 'rdr_RDGAllowManaulFlag', hidden:true, editable:false},<br />
 {name: 'rdr_CPReleaseDate', hidden:true, editable:false},<br />
 {name: 'rdr_UIDisplayFlag', hidden:true, editable:false}],<br />
 onSelectRow: function(id,status,event){<br />
 releaseDateResultProcessorObject.onReleaseDateSelectRow(id,status,event);<br />
 }</p>
<p>};<br />
 tableToGrid("#"+that.mainGridId, options);</p>
<p>var filterOptions = {<br />
 autosearch : true,<br />
 searchOnEnter : true,<br />
 searchOperators : true,<br />
 beforeSearch: function () {<br />
 that.modifySearchingFilter.call(this, ' ');<br />
 },<br />
 afterSearch : that.afterGridSearch()<br />
 };</p>
<p>var grid = $("#"+that.mainGridId),</p>
<p>getUniqueNames = function(columnName) {<br />
 var uniqueTexts = [];<br />
 var map = "";<br />
 if(columnName == 'rdr_tempPerm') {<br />
 map = releaseDateResultProcessorObject.dataMap.manualFlagMap;<br />
 } else if(columnName == 'rdr_relDateStatus') {<br />
 map = releaseDateResultProcessorObject.dataMap.releaseDateStatusMap;<br />
 } else if(columnName == 'rdr_relDateTags') {<br />
 map = releaseDateResultProcessorObject.dataMap.releaseDateTagMap;<br />
 }</p>
<p>for(var x in map){<br />
 if(map[x] != '' &#38;&#38; map[x].length &#62; 0)<br />
 uniqueTexts.push(map[x]);<br />
 }<br />
 return uniqueTexts;<br />
 },</p>
<p>buildSearchSelect = function(uniqueNames) {<br />
 var values=":All";<br />
 $.each (uniqueNames, function() {<br />
 values += ";" + this + ":" + this;<br />
 });<br />
 return values;<br />
 },</p>
<p>setSearchSelect = function(columnName) {<br />
 grid.jqGrid('setColProp', columnName,<br />
 {<br />
 stype: 'select',<br />
 searchoptions: {<br />
 value:buildSearchSelect(getUniqueNames(columnName)),<br />
 sopt: columnName === 'rdr_relDateTags' ? ['cn'] : ['eq']<br />
 }<br />
 }<br />
 );<br />
 };</p>
<p>setSearchSelect('rdr_tempPerm');<br />
 setSearchSelect('rdr_relDateStatus');<br />
 setSearchSelect('rdr_relDateTags');</p>
<p>$("#"+that.mainGridId).jqGrid('filterToolbar', filterOptions);</p>
<p>$("#"+that.mainGridId)<br />
 .jqGrid('destroyFrozenColumns')<br />
 .jqGrid('setFrozenColumns')<br />
 .trigger('reloadGrid', [{current:true}]);</p>
<p>};</p>
]]></description>
        	        	<pubDate>Thu, 04 Sep 2014 17:40:16 +0300</pubDate>
        </item>
</channel>
</rss>