EasyUI Forum
September 14, 2025, 09:11:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: format the datagrid header  (Read 8844 times)
pedroc
Newbie
*
Posts: 17


View Profile
« on: March 20, 2015, 08:17:16 AM »

i want to format a header of a grid with this structure:
$(function(){
        $('#tt').datagrid({
            ...
            columns:[[...]]
         });
});
this is the table header
<thead>
        <tr align="center">
            <th rowspan="3" field='expediente'>Nr. Expte.</th>
            <th rowspan="3" data-options="field:'nombre',editor:'text'">Nombre&nbsp;y&nbsp;Apellidos</th>
            <th rowspan="3" field='grupo_escala'>GE</th>
            <th rowspan="3" field='categoria_ocupacional'>CO</th>
            <th rowspan="3" field='percapita'>Percap. CUC</th>
            <th rowspan="3" field='iedocpl'>IED o CPL</th>
            <th colspan="4" >% Penalizaciones</th>
            <th rowspan="3" field='ttd'>Tiempo Total para la Divisa</th>
            <th rowspan="3" field='stsp'>Salario Total Sistema Pago</th>
            <th rowspan="3" field='sb'>Salario Base Calculo</th>
            <th rowspan="3" field='ff'>Fondo Formado</th>
            <th rowspan="3" field='cd'>Coefic. Distrib.</th>
            <th rowspan="3" field='mmn'>Monto MN</th>
            <th rowspan="3" field='pmn'>Penaliz. en MN</th>
            <th rowspan="3" field='mpmn'>Monto a pagar en MN</th>
            <th rowspan="3" field='mcuc'>Monto en Divisa</th>
            <th rowspan="3" field='pcuc'>Penaliz. en Divisa</th>
            <th rowspan="3" field='mpcuc'>Monto a pagar en Divisa</th>
        </tr>
        <tr align="center">
            <th colspan="2">Cond_Esp.</th>
            <th colspan="2">CPL</th>
        </tr>
        <tr align="center">
            <th field='penl_ce_mn'>MN</th>
            <th field='penl_ce_cuc'>CUC</th>
            <th field='penl_cpl_mn'>MN</th>
            <th field='penl_cpl_cuc'>CUC</th>
        </tr>
    </thead>
Logged
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« Reply #1 on: March 24, 2015, 09:08:00 AM »

You can use following code to define column header using script.
Code:
$(function(){
        $('#tt').datagrid({
            ...
            columns:[[{field:'field1',title:'COLUMN HEADER HERE',width:100} ... ]]
         });
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!