Colorize row in SubGrid ?

Hello

Is there any difference in colorizing subGrid’s?
I used “setRowTextStyle” in normal Grid’s and always works fine. I just want to mark the clicked row and set a value.
Here is m code:

Grid[2].attachEvent("onSubGridCreated", function(subGrid, rId, rInd){ 			   
   subGrid.setImagePath("../dhtmlx/FilesManager/codebase/imgs/");
   subGrid.setIconsPath("../dhtmlx/FilesManager/icons/grid/");
   subGrid.setHeader(",,,<span style='position:relative; left:-6px;color:#900'>Datei</span>,<span style='padding-left:12px;color:#900'>Größe</span>,<span style='padding-left:26px;color:#900'>Typ</span>,<span style='color:#900'>Upload Datum</span>");
   subGrid.attachHeader(",,,#text_filter,#numeric_filter,#select_filter,#text_filter");
   subGrid.setColTypes("img,img,ro,ro,ro,ro,ro"); 
   subGrid.setInitWidths("28,28,28,*,80,95,115");
   subGrid.setColSorting("str,str,int,str,int,str,str");
   subGrid.setColAlign("center,center,center,left,center,center,left");
   subGrid.enableTooltips("false,false,false,true,false,false,false");
   subGrid.enableRowsHover(true, 'grid_hover_sub');		
   subGrid.attachEvent("onRowSelect", function(id,cInd) { 
      var rId = subGrid.getRowIndex(id); 
				  
      if (cInd == 1) { 
         var antwort = confirm("Achtung !\nDie Datei '"+id+"' wird unwiderruflich gelöscht !\n");
         if (antwort) { 
            //deleteFileContent(id); 
            subGrid.cells(rId, 2).setValue('1');			 
            subGrid.setRowTextStyle(rId,"background-color:#900");
         }
      } else { 
           showFileContent(id); 
      } 
   });

   subGrid.attachEvent("onRowCreated", function(rId,rObj,rXml){ subGrid.cells(rId, 4).setValue(parseBytes(subGrid.cells(rId, 4).getValue())); });
   subGrid.init();			   
   subGrid.enableAlterCss("rows_even_sub", "rows_uneven_sub");			   
   dhtmlxEvent(window, "resize", function(){ window.setTimeout(function(){ subGrid.callEvent("onGridReconstructed",[]); },200); });
			   
   return true;
});	

Thank you

Hmm … i have the same problems with

subGrid.setColumnHidden(2,true);

Does not work in subGrid. Maybe i have a problem in my JS-Ordering?

<link href="../dhtmlx/Layout/dhtmlxlayout.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Layout/skins/dhtmlxlayout_dhx_web.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Tabbar/dhtmlxtabbar.css" rel="stylesheet" type="text/css">  
<link href="../dhtmlx/Grid/codebase/dhtmlxgrid.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Grid/codebase/skins/dhtmlxgrid_dhx_skyblue.css" rel="stylesheet" type="text/css"> 
<link href="../dhtmlx/Form/skins/dhtmlxform_dhx_terrace.css" rel="stylesheet" type="text/css">      
<link href="../dhtmlx/FilesManager/codebase/dhtmlx.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Window/dhtmlxwindows.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Window/skins/dhtmlxwindows_dhx_skyblue.css" rel="stylesheet" type="text/css">
<link href="../dhtmlx/Calendar/dhtmlxcalendar.css" rel="STYLESHEET" type="text/css">
<link href="../dhtmlx/Calendar/skins/dhtmlxcalendar_dhx_skyblue.css" rel="STYLESHEET" type="text/css">

<script src="../js/dispotool.js"></script>
<script src="../js/toolbar.js"></script>
<script src="../dhtmlx/Window/dhtmlxcommon.js"></script>
<script src="../dhtmlx/Window/dhtmlxwindows.js"></script>
<script src="../dhtmlx/Window/dhtmlxcontainer.js"></script>       
<script src="../dhtmlx/Grid/codebase/dhtmlxcommon.js"></script>
<script src="../dhtmlx/Grid/codebase/dhtmlxgrid.js"></script>        
<script src="../dhtmlx/Grid/codebase/dhtmlxgridcell.js"></script>   
<script src="../dhtmlx/FilesManager/codebase/dhtmlx.js"></script> 
<script src="../dhtmlx/Grid/codebase/excells/dhtmlxgrid_excell_sub_row.js"></script>
<script src="../dhtmlx/Tabbar/dhtmlxcommon.js"></script>
<script src="../dhtmlx/Tabbar/dhtmlxtabbar.js"></script>	
<script src="../dhtmlx/Tabbar/dhtmlxcontainer.js"></script>            
<script src="../dhtmlx/Layout/dhtmlxcommon.js"></script>
<script src="../dhtmlx/Layout/dhtmlxlayout.js"></script>
<script src="../dhtmlx/Layout/dhtmlxcontainer.js"></script>
<script src="../dhtmlx/Form/dhtmlxcommon.js"></script>
<script src="../dhtmlx/Form/dhtmlxform.js"></script>
<script src="../dhtmlx/Form/ext/dhtmlxform_item_upload.js"></script>
<script src="../dhtmlx/Form/ext/swfobject.js"></script>   

setRowTextStyle() method works well for us in the subgrid.

Please, note that here:
subGrid.setRowTextStyle(rId,“background-color:#900”);

rId is an index of the rows but not the id:
subGrid.attachEvent(“onRowSelect”, function(id,cInd) {
var rId = subGrid.getRowIndex(id);
…

If issue still occurs for you - please, provide with a complete demo, where the issuwe can be reproduced.

OK … thank you … that helped a lot but i still have problems with my hidden column:

.
.
subGrid.attachEvent("onRowCreated", function(rId,rObj,rXml){ subGrid.cells(rId, 4).setValue(parseBytes(subGrid.cells(rId, 4).getValue())); });
subGrid.init();
subGrid.setColumnHidden(2,true);			   
subGrid.enableAlterCss("rows_even_sub", "rows_uneven_sub");			   
dhtmlxEvent(window, "resize", function(){ window.setTimeout(function(){ subGrid.callEvent("onGridReconstructed",[]); },200); });

If i click “+” happens nothing.

Thank you

please, provide with a complete demo, where the issue can be reproduced.
Here you can find a tutorial:
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Sent you a PM

Thank you

In your demo you’ve included dhtmlx.js from a standard version of dhtmlx.
This version have no setColumnHidden() method.
Please, disclude that file for a correct init.

Note: it is not recommended to include compiled dhtmlx.js if you are using separate js files (dhtmlxcommon.js, dhtmlxgrid.js, dhtmlxgridcell.js …)

Thank you so much .. that helped.
Maybe you can help me now with my last little problem. I have a Layout “3W” and as you can see at the picture there is a big grey border around the cells. How can i eleminate this? Because of that border i also can’t see the full scrollbar.

Thank you sematik


Hello
Try to apply the next 3 styles:

     table.dhtmlxLayoutPolyContainer_dhx_web td.dhtmlxLayoutPolySplitterVerInactive {
        width: 1px;
     }
     table.dhtmlxLayoutPolyContainer_dhx_web td.dhtmlxLayoutSinglePoly{
              background: none;
     }
     .dhxlayout_fullscreened{
         background: none;
     }

Thank you :slight_smile: