Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by kb on Aug 19, 2008 09:40
open dhtmlx forum
v1.6 Grid losing row class after filtering or sorting

Hello,

With v1.6 of the grid I noticed that the override class I set in XML for a row is being dropped after data filtering or column sorting occurs. This does not occur with previous versions of the grid.

Xml example:

<rows>
<row class="redText">
<cell>value 1</cell>
<cell>value 2</cell>
</row>
<row>
<cell>value 3</cell>
<cell>value 4</cell>
</row>
</rows>

Please advise.

Thanks,

kb
Answer posted by Support on Aug 20, 2008 02:01

If pronblem occurs in case of Smart Rendering mode - please use attached js file instead of original one, it will resovle issue. 

Attachments (1)
Answer posted by kb on Aug 20, 2008 06:53

Thanks for the quick reply but I am not using smart rendering mode, below is the exact code I am attempting to test:

<html>
 <head>
  <title>grid cell row class</title>
  <link rel="STYLESHEET" type="text/css" href="../dhtmlx/grid/dhtmlxgrid.css">
  <link rel="STYLESHEET" type="text/css" href="../dhtmlx/grid/dhtmlxgrid_skins.css">
  <script  src="../dhtmlx/common/dhtmlxcommon.js"></script>
  <script  src="../dhtmlx/grid/dhtmlxgrid.js"></script>  
  <script  src="../dhtmlx/grid/dhtmlxgridcell.js"></script>
  <SCRIPT src="../dhtmlx/grid/dhtmlXGrid_filter.js"></SCRIPT>
  <style>
   .rowRedText
   {
    color:red;
   }
  </style>
 </head>
 <body>
  <div id="gridbox" style="height:300px;width:300px;background-color:white;"></div>
  <script>
       mygrid = new dhtmlXGridObject('gridbox');
       mygrid.setImagePath("../dhtmlx/images/");
       mygrid.setHeader("Column 1,Column 2,column 3");
       mygrid.setInitWidths("100,100,100")
       mygrid.setColAlign("center,center,center")
       mygrid.setColTypes("ro,ro,ro");
       mygrid.setColSorting("str,str,str")
       mygrid.attachHeader("#select_filter,#rspan,#rspan");
       mygrid.setSkin("light");
       mygrid.init();
       mygrid.loadXMLString('<rows><row id="1" class="rowRedText"><cell>Value 1</cell><cell>Value 2</cell><cell>Value 3</cell></row><row id="2"><cell>Value 4</cell><cell>Value 5</cell><cell>Value 6</cell></row></rows>');
  </script>
 </body>
</html>

Seems like I am seeing the issue when I am setting the skin to "light".

Answer posted by Support on Aug 20, 2008 07:35
Problem confirmed and fixed.
Fix will be released as part of next build. 
Fixed js file sent by email. 
Answer posted by kb on Aug 20, 2008 08:13

I also noticed that the grid no longer automatically scrolls when I select a row at the bottom of the grid and then hit the down arrow to view the next row. 

Is there a new setting that enables auto scrolling?

Answer posted by Support on Aug 20, 2008 09:47
Version which was sent by email, contain fix for such issue as well.