3.2.0

setHeaderText() Problem

Hello,
I have a grid with 9 colums. When I run my web aplication, the grid show data correctly but not the header row.
The header row only show 3 colums name.
I use setHeaderText(["Proyecto","Cliente","Version"...]) but not show all the names, only show 3 headers name.
Please can you help me?
This is what i do:

var DGridDatos = new AW.UI.Grid;
DGridDatos.setId("DGridDatos");

var tablaDatos = new AW.XML.Table;
tablaDatos.setURL("webservice.asmx/construyeDataSetGenerico");

var ssql = "SELECT " + QuitarNulos("ZTECDatos.id","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.CodDato","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.DescDato","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.CodProy","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.VersionSolucionado","''") +", ";
ssql+= QuitarNulos("ZTECDatos.Fecha","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.CodStatus","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.CodPrioridad","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.CodTipoDato","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.CodResponsable","''") + ", ";
ssql+= QuitarNulos("ZTECDatos.Revisado","''")+ ", ";
ssql+= QuitarNulos("ZTECDatos.Dudas","''") + ", ";
ssql+= QuitarNulos("ZTECProyectos.NomProy","''") + ", ";
ssql+= QuitarNulos("ZTECStatus.NomStatus","''") + ", ";
ssql+= QuitarNulos("ZTECPrioridades.NomPrioridad","''") + ", ";
ssql+= QuitarNulos("ZTECTiposDatos.NomTipoDatoCorto","''") + ", ";
ssql+= QuitarNulos("ZTECTiposDatos.NomTipoDatoLargo","''") + ", ";
ssql+= QuitarNulos("ZTECResponsables.NomResponsableCorto","''") + ", ";
ssql+= QuitarNulos("ZTECResponsables.NomResponsableLargo","''") + ", ";
ssql+= QuitarNulos("ZTECClientes.NomCli","''");
ssql+= " FROM ((((((ZTECDatos INNER JOIN ZTECProyectos ON ZTECDatos.CodProy =";
ssql+= " ZTECProyectos.CodProy) INNER JOIN ZTECStatus ON ZTECDatos.CodStatus = ZTECStatus.CodStatus)";
ssql+= " INNER JOIN ZTECPrioridades ON ZTECDatos.CodPrioridad = ZTECPrioridades.CodPrioridad)";
ssql+= " INNER JOIN ZTECTiposDatos ON ZTECDatos.CodTipoDato = ZTECTiposDatos.CodTipoDato)";
ssql+= " INNER JOIN ZTECResponsables ON ZTECDatos.CodResponsable = ZTECResponsables.CodResponsable)";
ssql+= " INNER JOIN ZTECClientes ON ZTECProyectos.CodCli= ZTECClientes.CodCli)";
ssql+= " ORDER BY ZTECDatos.Fecha desc, ZTECDatos.CodDato desc";

tablaDatos.setParameter("Consulta", ssql);
tablaDatos.setParameter("Conexion", Conexion);
tablaDatos.setParameter("NomTabla", "Datos");
tablaDatos.setRequestMethod("POST");
tablaDatos.setRows("//NewDataSet/*");
tablaDatos.request();

var ColDGridDatosCodDato = 1;
var ColDGridDatosProyecto = 12 ;
var ColDGridDatosNomCliente = 19;
var ColDGridDatosVersSol = 4;
var ColDGridDatosFecha = 5;
var ColDGridDatosStatus = 13;
var ColDGridDatosPrioridad = 14;
var ColDGridDatosTipo = 15;
var ColDGridDatosResponsable = 17;

DGridDatos.setCellModel(tablaDatos);
DGridDatos.setColumnCount(9);
DGridDatos.setHeaderText(["Código","Proyecto","Nom.Cliente","V.Sol","Fecha","Status","Prioridad","Tipo","Responsable"]); //There is the problem, only show "Proyecto","Fecha","Status"
DGridDatos.setColumnIndices([ColDGridDatosCodDato,ColDGridDatosProyecto,ColDGridDatosNomCliente,ColDGridDatosVersSol,ColDGridDatosFecha,ColDGridDatosStatus,ColDGridDatosPrioridad,ColDGridDatosTipo,ColDGridDatosResponsable]);
DGridDatos.setSelectorVisible(false);
TECNORA
April 15,
http://www.activewidgets.com/javascript.forum.15597.4/loading-a-csv.html
April 15,
ok, but my problem is only in the header display other cells of grid are ok. Can I use a CSV table only for load the header´s text?
TECNORA
April 16,
When you assign header text you should use the same column indices -

Instead of

DGridDatos.setHeaderText(["Código","Proyecto","Nom.Cliente","V.Sol"]);


it should be
DGridDatos.setHeaderText({
   ColDGridDatosCodDato: "Código",
   ColDGridDatosProyecto: "Proyecto",
   ColDGridDatosNomCliente: "Nom.Cliente",
   ColDGridDatosVersSol: "V.Sol"
});
Alex (ActiveWidgets)
April 16,
ok, but if i put this:

DGridDatos.setHeaderText({
ColDGridDatosCodDato: "Código",
ColDGridDatosProyecto: "Proyecto",
ColDGridDatosNomCliente: "Nom.Cliente",
ColDGridDatosVersSol: "V.Sol"
});

don´t work ok, but if I put the number of colum works ok:

DGridDatos.setHeaderText({
1: "Código",
12: "Proyecto",
19: "Nom.Cliente",
4: "V.Sol"
});

Why?
TECNORA
April 16,
oops, sorry - that syntax really does not work, so you have to use

DGridDatos.setHeaderText({
1: "Código",
12: "Proyecto",
19: "Nom.Cliente",
4: "V.Sol"
});

or

var ht = {};
ht[ColDGridDatosCodDato] = "Código";
ht[ColDGridDatosProyecto] = "Proyecto";
ht[ColDGridDatosNomCliente] = "Nom.Cliente";
ht[ColDGridDatosVersSol] = "V.Sol";
DGridDatos.setHeaderText(ht);

or

DGridDatos.setHeaderText("Código", ColDGridDatosCodDato);
DGridDatos.setHeaderText("Proyecto", ColDGridDatosProyecto);
DGridDatos.setHeaderText("Nom.Cliente", ColDGridDatosNomCliente);
DGridDatos.setHeaderText("V.Sol", ColDGridDatosVersSol);



Alex (ActiveWidgets)
April 16,
Thanks you very much, It works OK
Tecnora
April 17,

This topic is archived.

See also:


Back to support forum