Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Victor Lopez on Mar 04, 2009 10:45
open dhtmlx forum
DhtmlxGrid problem displaying table in Firefox

Hi, I have a problem in firefox displaying tables with dhtmlxGrid.

Cells are not align with header, ie shows it ok, but in firefox cells are shown a little displaced to the left.

-------------------------------------------------------

|  header1  | header 2  | header 3       |

-------------------------------------------------------

| cell1     |    cell2   |  cell3     |

------------------------------------------

|  cell1    |   cell2    |  cell3     |

------------------------------------------

 

More or less this is the result table, excuse "picture". If needed i'll upload an image with the table

 

here is the code that formats the table:

public function ConvertirJava%>
  <script  src="componentes/dhtmlxGrid/js/dhtmlXCommon.js"></script>
  <script  src="componentes/dhtmlxGrid/js/dhtmlXGrid.js"></script>
  <script  src="componentes/dhtmlxGrid/js/dhtmlXGridCell.js"></script>
  <script  src="componentes/dhtmlxGrid/js/dhtmlXGrid_start.js"></script>
  <link type="text/css" href="componentes/dhtmlxGrid/css/dhtmlXGrid.css" rel="stylesheet"/>
  <script language="javascript">
   var mygrid = new dhtmlXGridFromTable('<%=nombrelista%>');
   mygrid.setImagePath("componentes/dhtmlxGrid/imgs/");
     mygrid.enableAutoHeigth(true);
    mygrid.setSkin("op");
   mygrid.setEditable(false);
   // mygrid.setHeader("Nombre,Tipo,Estado,Promotor,Direccion,Expediente")
   //mygrid.setColSorting("str,str,str,str,str,str");
   // mygrid.enableLightMouseNavigation(true);
        mygrid.enableKeyboardSupport(true);
    // mygrid.doDynScroll(true);
   for (x=0 ;x<mygrid.getRowsNum();x++)
   {
    mygrid.setRowTextStyle(mygrid.getRowId(x),'color:grey;font-family:verdana;font-size:10px;')
   }
  </script>
 <%end function

 

Thanks in advance

 

Answer posted by dhxSupport on Mar 05, 2009 01:19

What version of dhtmlxGrid do you use?

Please provide screenshot or sample including files which you use to initialize grid.

Also mygrid.setSkin("op"); is "op" custom grid's sking? If yes, try to set native grid's skin and check if issue will still occur.

Answer posted on Mar 05, 2009 02:36

Native skin has solved the aligment of cells with header, but the table does not fit 100% to the with of page neither in firefox nor in IE, both screenshots are included. Original table does fit to 100%

I've tried both v1.5 build 71114 and v.2.0 build 81009 with same result

this is source code that creates initial table:

<table id="<%=nombrelista%>" width="<%=anchotabla%>">
  <tr>
  <%'mostramos el nombre de las columnas
  for x=0 to listacampos.count-1
   if not ocultarIds or claves(x)<>id  then
   %>
   <td id="<%=claves(x)%>"><%=replace(listacampos(claves(x)).etiquetacampo,":","")%></td>
   <%
   end if
  next%>
  </tr>
  <%while not rslistado.eof%>
   <tr id="<%=rslistado(id)%>" onDblClick="window.location.href='<%=paginaClick&rslistado(id)%>'">
  <%for x=0 to listacampos.count-1
  valor="--"
   if not ocultarIds or claves(x)<>id  then
   'response.write "<b>"&rslistado(claves(x))&"</b>"
    if listacampos(claves(x)).esforanea=false then%>
     <td><%
     valor=rslistado(claves(x))
    
     if isnull(valor) or valor="" then valor="--"
     if valor=true  then
      valor="Si"
     elseif valor=False then
      valor="No"
     end if
      
     response.write valor
     %></td>
    <%else
     set rsforanea=formu.rsescritura(listacampos(claves(x)).conexionforanea,listacampos(claves(x)).sqlforanea)
     if rsforanea.recordcount>0 then
     'response.write rsforanea.fields(0).name&"="&rslistado(claves(x))
      rsforanea.find (rsforanea.fields(0).name&"="&rslistado(claves(x)))
      if not rsforanea.eof then valor=rsforanea(1)
     end if%>
     <td><%if valor=null or valor="" then valor="--"
     '*** prevenir errores por numeros con comas ********
     if not isnull(valor) then
      if isnumeric(replace(valor,",",".")) then valor=replace(valor,",",".") 
     end if
     response.write valor
     %></td>
    <%
    set rsforanea=nothing
    end if%>
    
   <%end if
  next%>
  </tr>
  </tr>
  <%
  rslistado.movenext
  wend%>
  </table>

Any ideas?

 

Attachments (2)
ie.JPG121.89 Kb
Firefox.JPG97.33 Kb