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

DataTable to stretch full width of container?

Expand Messages
  • Eric P
    Hi, I have a DataTable inside a div. I m trying to figure out how to have the DataTable stretch to the width of the div. I ve tried using the width attribute
    Message 1 of 3 , Aug 2, 2009
    View Source
    • 0 Attachment
      Hi,

      I have a DataTable inside a div. I'm trying to figure out how to have the DataTable stretch to the width of the div.

      I've tried using the width attribute as shown in this example (taken from the "Complex Example of Multiple Features"
      example).

      var myColumnDefs = [
      {key:"areacode",label:"Area Codes",width:100,resizeable:true,sortable:true},
      {key:"state",label:"States",width:250,resizeable:true,sortable:true, sortOptions:{sortFunction:sortStates}},
      {key:"notes",label:"Notes (editable)",editor:"textbox",resizeable:true,sortable:true}
      ];

      But those width values are pixel values; I couldn't get a percentage to work there.

      I also see a setColumnWidth method, but the API says that is for pixel values as well.

      Thanks for reading,
      Eric P.
    • Satyam
      See: http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734
      Message 2 of 3 , Aug 2, 2009
      View Source
      • 0 Attachment
        See:

        http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734
        <http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734>



        Eric P escribió:
        > Hi,
        >
        > I have a DataTable inside a div. I'm trying to figure out how to have the DataTable stretch to the width of the div.
        >
        > I've tried using the width attribute as shown in this example (taken from the "Complex Example of Multiple Features"
        > example).
        >
        > var myColumnDefs = [
        > {key:"areacode",label:"Area Codes",width:100,resizeable:true,sortable:true},
        > {key:"state",label:"States",width:250,resizeable:true,sortable:true, sortOptions:{sortFunction:sortStates}},
        > {key:"notes",label:"Notes (editable)",editor:"textbox",resizeable:true,sortable:true}
        > ];
        >
        > But those width values are pixel values; I couldn't get a percentage to work there.
        >
        > I also see a setColumnWidth method, but the API says that is for pixel values as well.
        >
        > Thanks for reading,
        > Eric P.
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.392 / Virus Database: 270.13.41/2277 - Release Date: 08/02/09 05:56:00
        >
        >
      • Eric P
        Thanks! Eric
        Message 3 of 3 , Aug 4, 2009
        View Source
        • 0 Attachment
          Thanks!

          Eric

          Satyam wrote:
          >
          >
          > See:
          >
          > http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734
          > <http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734>
          > <http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734
          > <http://yuilibrary.com/forum/viewtopic.php?f=90&t=487&p=1734#p1734>>
          >
          > Eric P escribió:
          > > Hi,
          > >
          > > I have a DataTable inside a div. I'm trying to figure out how to have
          > the DataTable stretch to the width of the div.
          > >
          > > I've tried using the width attribute as shown in this example (taken
          > from the "Complex Example of Multiple Features"
          > > example).
          > >
          > > var myColumnDefs = [
          > > {key:"areacode",label:"Area
          > Codes",width:100,resizeable:true,sortable:true},
          > > {key:"state",label:"States",width:250,resizeable:true,sortable:true,
          > sortOptions:{sortFunction:sortStates}},
          > > {key:"notes",label:"Notes
          > (editable)",editor:"textbox",resizeable:true,sortable:true}
          > > ];
          > >
          > > But those width values are pixel values; I couldn't get a percentage
          > to work there.
          > >
          > > I also see a setColumnWidth method, but the API says that is for
          > pixel values as well.
          > >
          > > Thanks for reading,
          > > Eric P.
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > > ----------------------------------------------------------
          > >
          > >
          > > No virus found in this incoming message.
          > > Checked by AVG - www.avg.com
          > > Version: 8.5.392 / Virus Database: 270.13.41/2277 - Release Date:
          > 08/02/09 05:56:00
          > >
          > >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.