Configuring Grid

I want to configure my grid with javascript functions, not in HTML. It’s possible?

I’m trying with onbeforeinit but it doesn’t work. Headers, withds, types dont change.



My code:



<%@ taglib uri=“http://java.sun.com/jsp/jstl/core” prefix=“c”%>





































<c:forEach var=“nodo” items="${myList}">















</c:forEach>

nombre apellidos dni sueldo fecha
${nodo.nombre} ${nodo.apellidos} ${nodo.dni} ${nodo.sueldo} ${nodo.fecha}









You foget to include

The page is called by Struts Sitemesh and this “” is include in the layout.


Every dhtmlx component has it’s own “dhtmlxcommon.js” file. You have to include one file for the dhtmlxGrid and other for the dhtmlxLayout:







This is a paragraph from the documentation

"If you need to use more than one component in your application you can put files from their codebase folders into one. The only conflict can be with dhtmlxcommon.js file, as it is included in all components. Do not hesitate  to overwrite them, just make sure you keep the one which is most recent (this is important when you get component updates. Originally dhtmlxcommon.js is the same in all components codebase folders)."

Do I have to include dhtmlxcommon for every component???

Yes, you have to include dhtmlxcommon for every component

Yes, you have to include dhtmlxcommon for every component

Here is another example. Headers, withds, types… dont change.



<%@ page contentType=“text/html; charset=UTF-8” %>


   
        <link  href="…/codebase/dhtmlxgrid.css" rel=“stylesheet” type=“text/css”>
       
                
                
       
   

   
       


           
               
               
               
               
               
           
           
               
               
               
               
               
           
           
               
               
               
               
               
           
       
nombre apellido dni sueldo fecha
Felipe Perez 38.124.586-Z 35896.25 22/08/1962
Manuel Rodriguez 14.256.859-R 24869.87 02/03/1973


       
   



If you initialize grid from table via creating dhtmlXGridFromTable object, you can work only with methods which can be called after grid initialization.


To set column width use setColWidth(ind, value) method where ind - column index, value - new width value.

Also you have both css class ( class=“dhtmlxGrid” ) and js command which lead to double-initialization. Just remove css class for more stable work
The column parameters , such as width , type, align, sort can be defined directly at part of html table instead of commands

<table …


nombre