Loading ...
Sorry, an error occurred while loading the content.
 

Re: Hide text value from a datatable column header

Expand Messages
  • rajtf
    I guess we are talking two different things. Running your code it seems you are trying to hide a column entirely. (Btw: there is couple of typos in the code).
    Message 1 of 13 , Aug 1, 2007
      I guess we are talking two different things.
      Running your code it seems you are trying to hide a column entirely.
      (Btw: there is couple of typos in the code).

      What I am trying to do is to hide the columnheader entirely in a
      datatable.
      Not the column of data.

      Looking for a function like

      singleRowDataTable.getTableHeader().hide(); :)

      Thanks
      _Pete



      --- In ydn-javascript@yahoogroups.com, "caraconan2" <caraconan2@...>
      wrote:
      >
      > The sample code:
      >
      > ...
      > Ajax datatable includes
      > ...
      >
      > <script type="text/javascript">
      >
      > var Encabezado =
      > [
      > {key:"col_2", text:"Dorsal", type:"number", sortable:true,
      > sortOptions:{defaultOrder:'desc'}},
      > {key:"col_3", text:"Nombre", type:"string", sortable:true},
      > ];
      > var Mi_columnset = new YAHOO.widget.ColumnSet(Encabezado);
      >
      > var Mi_listado_div_datos_plantilla_1 =
      > [
      > {col_1:"46af320bb3e66",col_2:1,col_3:"My_name_1"},
      > {col_1:"46af260bb3e66",col_2:2,col_3:"My_name_2"},
      > ];
      >
      > var Mi_fuentedatos = new
      > YAHOO.util.DataSource(Mi_listado_div_datos_plantilla_1);
      >
      > Mi_fuentedatos.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
      >
      > Mi_fuentedatos.responseSchema =
      > {
      > fields: ["col_1","col_2","col_3"]
      > };
      >
      > var Mi_tabladatos = new
      > YAHOO.widget.DataTable("div_datos_plantilla_1", Mi_columnset,
      > Mi_fuentedatos);
      >
      > </script>
      >
      > ----------------------------------------------------------
      >
      > And, for example, access to the row 2 'hidden' id (col_1):
      >
      > Mi_listado_div_datos_plantilla_1[1][0];
      >
      > Bye
      >
      >
      > --- In ydn-javascript@yahoogroups.com, "rajtf" <thatts@> wrote:
      > >
      > > Hi,
      > >
      > > Were you able to do this ? That is hide the column headers but
      just
      > > show the column in a table. I am trying to do the same, but was
      not
      > > able to.
      > >
      > > Thanks
      > > _Pete
      > >
      > > --- In ydn-javascript@yahoogroups.com, "caraconan2" <caraconan2@>
      > > wrote:
      > > >
      > > > Ok, I'm trying this structure:
      > > >
      > > > var My_columnset =
      > > > [
      > > > {key:"col_2", text:"Name", type:"string", sortable:true,
      > > > sortOptions:{defaultOrder:'desc'}},
      > > > {key:"col_3", text:"Surname.", type:"string", sortable:true,
      > > > sortOptions:{defaultOrder:'desc'}}
      > > > ];
      > > >
      > > > var Mi_columnset = new YAHOO.widget.ColumnSet(My_columnset);
      > > >
      > > >
      > > > YAHOO.example.my_list =
      > > > [
      > > > {col_1:1,col_2:"Name_1",col_3:"Surname_1"},
      > > > {col_1:1,col_2:"Name_2",col_3:"Surname_2"}
      > > > ];
      > > >
      > > > var My_datasource = new YAHOO.util.DataSource
      > > (YAHOO.example.my_list);
      > > > My_datasource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
      > > > My_datasource.responseSchema ={
      > > >
      > > fields: ["col_1","col_2","col_3"]
      > > >
      > > };
      > > > var My_datatable = new YAHOO.widget.DataTable("my_div",
      > > My_columnset,
      > > > My_datasource);
      > > >
      > > > Mi_datatable.select(My_datatable.getRow(0));
      > > >
      > > > When I inspect the page with Firebug, It seems no way to access
      to
      > > the
      > > > col_1 element for each row. In other words: I want to assign a
      > > unique
      > > > id to every row, but I don't want to print it with datatable.
      But,
      > > of
      > > > course, after the datatable is printed, I want to access it
      via,
      > > for
      > > > example, document.GetelementbyId().
      > > >
      > > > Thanks for your time
      > > >
      > > >
      > > >
      > > > --- In ydn-javascript@yahoogroups.com, "wyzfr" <wyzfr@> wrote:
      > > > >
      > > > > Hello.
      > > > >
      > > > > I still don't understand. If you don't put the key field in
      the
      > > > > columnheader this field will still be accesible throught the
      > > recordset
      > > > > but the datatatable won't show a column on the DataTable for
      > > this field.
      > > > >
      > > > > Best regards.
      > > > >
      > > > >
      > > > > <caraconan2@> wrote:
      > > > > >
      > > > > > I wan't to mantain that column, but I wan't the header
      > > > > > empty, without any tag
      > > > > >
      > > > > >
      > > > >
      > > >
      > >
      >
    • caraconan2
      Yes, we are talking different languages :) I m newby at Yui. Sorry, I can t help you :( Good luck
      Message 2 of 13 , Aug 3, 2007
        Yes, we are talking different languages :)

        I'm newby at Yui. Sorry, I can't help you :(

        Good luck

        --- In ydn-javascript@yahoogroups.com, "rajtf" <thatts@...> wrote:
        >
        > I guess we are talking two different things.
        > Running your code it seems you are trying to hide a column entirely.
        > (Btw: there is couple of typos in the code).
        >
        > What I am trying to do is to hide the columnheader entirely in a
        > datatable.
        > Not the column of data.
        >
        > Looking for a function like
        >
        > singleRowDataTable.getTableHeader().hide(); :)
        >
        > Thanks
        > _Pete
        >
        >
        >
        > --- In ydn-javascript@yahoogroups.com, "caraconan2" <caraconan2@>
        > wrote:
        > >
        > > The sample code:
        > >
        > > ...
        > > Ajax datatable includes
        > > ...
        > >
        > > <script type="text/javascript">
        > >
        > > var Encabezado =
        > > [
        > > {key:"col_2", text:"Dorsal", type:"number", sortable:true,
        > > sortOptions:{defaultOrder:'desc'}},
        > > {key:"col_3", text:"Nombre", type:"string", sortable:true},
        > > ];
        > > var Mi_columnset = new YAHOO.widget.ColumnSet(Encabezado);
        > >
        > > var Mi_listado_div_datos_plantilla_1 =
        > > [
        > > {col_1:"46af320bb3e66",col_2:1,col_3:"My_name_1"},
        > > {col_1:"46af260bb3e66",col_2:2,col_3:"My_name_2"},
        > > ];
        > >
        > > var Mi_fuentedatos = new
        > > YAHOO.util.DataSource(Mi_listado_div_datos_plantilla_1);
        > >
        > > Mi_fuentedatos.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
        > >
        > > Mi_fuentedatos.responseSchema =
        > > {
        > > fields: ["col_1","col_2","col_3"]
        > > };
        > >
        > > var Mi_tabladatos = new
        > > YAHOO.widget.DataTable("div_datos_plantilla_1", Mi_columnset,
        > > Mi_fuentedatos);
        > >
        > > </script>
        > >
        > > ----------------------------------------------------------
        > >
        > > And, for example, access to the row 2 'hidden' id (col_1):
        > >
        > > Mi_listado_div_datos_plantilla_1[1][0];
        > >
        > > Bye
        > >
        > >
        > > --- In ydn-javascript@yahoogroups.com, "rajtf" <thatts@> wrote:
        > > >
        > > > Hi,
        > > >
        > > > Were you able to do this ? That is hide the column headers but
        > just
        > > > show the column in a table. I am trying to do the same, but was
        > not
        > > > able to.
        > > >
        > > > Thanks
        > > > _Pete
        > > >
        > > > --- In ydn-javascript@yahoogroups.com, "caraconan2" <caraconan2@>
        > > > wrote:
        > > > >
        > > > > Ok, I'm trying this structure:
        > > > >
        > > > > var My_columnset =
        > > > > [
        > > > > {key:"col_2", text:"Name", type:"string", sortable:true,
        > > > > sortOptions:{defaultOrder:'desc'}},
        > > > > {key:"col_3", text:"Surname.", type:"string", sortable:true,
        > > > > sortOptions:{defaultOrder:'desc'}}
        > > > > ];
        > > > >
        > > > > var Mi_columnset = new YAHOO.widget.ColumnSet(My_columnset);
        > > > >
        > > > >
        > > > > YAHOO.example.my_list =
        > > > > [
        > > > > {col_1:1,col_2:"Name_1",col_3:"Surname_1"},
        > > > > {col_1:1,col_2:"Name_2",col_3:"Surname_2"}
        > > > > ];
        > > > >
        > > > > var My_datasource = new YAHOO.util.DataSource
        > > > (YAHOO.example.my_list);
        > > > > My_datasource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
        > > > > My_datasource.responseSchema ={
        > > > >
        > > > fields: ["col_1","col_2","col_3"]
        > > > >
        > > > };
        > > > > var My_datatable = new YAHOO.widget.DataTable("my_div",
        > > > My_columnset,
        > > > > My_datasource);
        > > > >
        > > > > Mi_datatable.select(My_datatable.getRow(0));
        > > > >
        > > > > When I inspect the page with Firebug, It seems no way to access
        > to
        > > > the
        > > > > col_1 element for each row. In other words: I want to assign a
        > > > unique
        > > > > id to every row, but I don't want to print it with datatable.
        > But,
        > > > of
        > > > > course, after the datatable is printed, I want to access it
        > via,
        > > > for
        > > > > example, document.GetelementbyId().
        > > > >
        > > > > Thanks for your time
        > > > >
        > > > >
        > > > >
        > > > > --- In ydn-javascript@yahoogroups.com, "wyzfr" <wyzfr@> wrote:
        > > > > >
        > > > > > Hello.
        > > > > >
        > > > > > I still don't understand. If you don't put the key field in
        > the
        > > > > > columnheader this field will still be accesible throught the
        > > > recordset
        > > > > > but the datatatable won't show a column on the DataTable for
        > > > this field.
        > > > > >
        > > > > > Best regards.
        > > > > >
        > > > > >
        > > > > > <caraconan2@> wrote:
        > > > > > >
        > > > > > > I wan't to mantain that column, but I wan't the header
        > > > > > > empty, without any tag
        > > > > > >
        > > > > > >
        > > > > >
        > > > >
        > > >
        > >
        >
      • rajtf
        Okay, I did the following and that fixed my problem. (for any one searching the same) .selectionexample th {visibility:hidden; } In the css of datatable
        Message 3 of 13 , Aug 13, 2007
          Okay, I did the following and that fixed my problem. (for any one
          searching the same)

          .selectionexample th {visibility:hidden; }

          In the css of datatable selecion example I did the above and that
          fixed the problem. Still there is a white space above the table, but
          I am okay with that.

          _Pete


          --- In ydn-javascript@yahoogroups.com, "caraconan2" <caraconan2@...>
          wrote:
          >
          > Yes, we are talking different languages :)
          >
          > I'm newby at Yui. Sorry, I can't help you :(
          >
          > Good luck
          >
          > --- In ydn-javascript@yahoogroups.com, "rajtf" <thatts@> wrote:
          > >
          > > I guess we are talking two different things.
          > > Running your code it seems you are trying to hide a column
          entirely.
          > > (Btw: there is couple of typos in the code).
          > >
          > > What I am trying to do is to hide the columnheader entirely in a
          > > datatable.
          > > Not the column of data.
          > >
          > > Looking for a function like
          > >
          > > singleRowDataTable.getTableHeader().hide(); :)
          > >
          > > Thanks
          > > _Pete
          > >
          > >
          > >
          > > --- In ydn-javascript@yahoogroups.com, "caraconan2" <caraconan2@>
          > > wrote:
          > > >
          > > > The sample code:
          > > >
          > > > ...
          > > > Ajax datatable includes
          > > > ...
          > > >
          > > > <script type="text/javascript">
          > > >
          > > > var Encabezado =
          > > > [
          > > > {key:"col_2", text:"Dorsal", type:"number", sortable:true,
          > > > sortOptions:{defaultOrder:'desc'}},
          > > > {key:"col_3", text:"Nombre", type:"string", sortable:true},
          > > > ];
          > > > var Mi_columnset = new YAHOO.widget.ColumnSet(Encabezado);
          > > >
          > > > var Mi_listado_div_datos_plantilla_1 =
          > > > [
          > > > {col_1:"46af320bb3e66",col_2:1,col_3:"My_name_1"},
          > > > {col_1:"46af260bb3e66",col_2:2,col_3:"My_name_2"},
          > > > ];
          > > >
          > > > var Mi_fuentedatos = new
          > > > YAHOO.util.DataSource(Mi_listado_div_datos_plantilla_1);
          > > >
          > > > Mi_fuentedatos.responseType =
          YAHOO.util.DataSource.TYPE_JSARRAY;
          > > >
          > > > Mi_fuentedatos.responseSchema =
          > > > {
          > > > fields: ["col_1","col_2","col_3"]
          > > > };
          > > >
          > > > var Mi_tabladatos = new
          > > > YAHOO.widget.DataTable("div_datos_plantilla_1", Mi_columnset,
          > > > Mi_fuentedatos);
          > > >
          > > > </script>
          > > >
          > > > ----------------------------------------------------------
          > > >
          > > > And, for example, access to the row 2 'hidden' id (col_1):
          > > >
          > > > Mi_listado_div_datos_plantilla_1[1][0];
          > > >
          > > > Bye
          > > >
          > > >
          > > > --- In ydn-javascript@yahoogroups.com, "rajtf" <thatts@> wrote:
          > > > >
          > > > > Hi,
          > > > >
          > > > > Were you able to do this ? That is hide the column headers
          but
          > > just
          > > > > show the column in a table. I am trying to do the same, but
          was
          > > not
          > > > > able to.
          > > > >
          > > > > Thanks
          > > > > _Pete
          > > > >
          > > > > --- In ydn-javascript@yahoogroups.com, "caraconan2"
          <caraconan2@>
          > > > > wrote:
          > > > > >
          > > > > > Ok, I'm trying this structure:
          > > > > >
          > > > > > var My_columnset =
          > > > > > [
          > > > > > {key:"col_2", text:"Name", type:"string",
          sortable:true,
          > > > > > sortOptions:{defaultOrder:'desc'}},
          > > > > > {key:"col_3", text:"Surname.", type:"string",
          sortable:true,
          > > > > > sortOptions:{defaultOrder:'desc'}}
          > > > > > ];
          > > > > >
          > > > > > var Mi_columnset = new YAHOO.widget.ColumnSet(My_columnset);
          > > > > >
          > > > > >
          > > > > > YAHOO.example.my_list =
          > > > > > [
          > > > > > {col_1:1,col_2:"Name_1",col_3:"Surname_1"},
          > > > > > {col_1:1,col_2:"Name_2",col_3:"Surname_2"}
          > > > > > ];
          > > > > >
          > > > > > var My_datasource = new YAHOO.util.DataSource
          > > > > (YAHOO.example.my_list);
          > > > > > My_datasource.responseType =
          YAHOO.util.DataSource.TYPE_JSARRAY;
          > > > > > My_datasource.responseSchema ={
          > > > > >

          > > > > fields: ["col_1","col_2","col_3"]
          > > > > >

          > > > > };
          > > > > > var My_datatable = new YAHOO.widget.DataTable("my_div",
          > > > > My_columnset,
          > > > > > My_datasource);
          > > > > >
          > > > > > Mi_datatable.select(My_datatable.getRow(0));
          > > > > >
          > > > > > When I inspect the page with Firebug, It seems no way to
          access
          > > to
          > > > > the
          > > > > > col_1 element for each row. In other words: I want to
          assign a
          > > > > unique
          > > > > > id to every row, but I don't want to print it with
          datatable.
          > > But,
          > > > > of
          > > > > > course, after the datatable is printed, I want to access it
          > > via,
          > > > > for
          > > > > > example, document.GetelementbyId().
          > > > > >
          > > > > > Thanks for your time
          > > > > >
          > > > > >
          > > > > >
          > > > > > --- In ydn-javascript@yahoogroups.com, "wyzfr" <wyzfr@>
          wrote:
          > > > > > >
          > > > > > > Hello.
          > > > > > >
          > > > > > > I still don't understand. If you don't put the key field
          in
          > > the
          > > > > > > columnheader this field will still be accesible throught
          the
          > > > > recordset
          > > > > > > but the datatatable won't show a column on the DataTable
          for
          > > > > this field.
          > > > > > >
          > > > > > > Best regards.
          > > > > > >
          > > > > > >
          > > > > > > <caraconan2@> wrote:
          > > > > > > >
          > > > > > > > I wan't to mantain that column, but I wan't the header
          > > > > > > > empty, without any tag
          > > > > > > >
          > > > > > > >
          > > > > > >
          > > > > >
          > > > >
          > > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.