Width on elements does not accept percentage.

  1. #1

    Width on elements does not accept percentage.

    *There are certain situations where setting a width of a percentage is useful. *Any time you try to set the with on say a "text" box or some other type <ext: control you always get the error below: Is there anyway to allow a percentage to be specified?

    <h2>The Unit Type for the uid Width property must be of Type 'Pixel'.
    Example: Unit.Pixel(150) or '150px'.
    </h2><h2>
    </h2><h2>
    </h2>
  2. #2

    RE: Width on elements does not accept percentage.

    Hi JMan,

    The majority of the "Width" properties will only accept Pixels, although there may be exceptions to that rule and certain work-arounds depending on the scenario.


    It's a bit tough to give you a definitive answer, although if you are using form controls (TextField, etc) you can use an AnchorLayout or FormLayout and set the Horizontal property of the <ext:Anchor>. There are certainly options with the TableLayout as well.*


    The following ExtJS documentation provides further information re: the AnchorLayout, see*http://www.extjs.com/deploy/dev/docs...t.AnchorLayout


    Hope this helps.


    Geoffrey McGill
    Founder

Similar Threads

  1. Height , Width in percentage
    By AnandVishnu in forum 1.x Help
    Replies: 1
    Last Post: Oct 31, 2011, 1:48 PM
  2. How to define width in percentage
    By ACustodio in forum 1.x Help
    Replies: 3
    Last Post: Jul 29, 2011, 9:02 PM
  3. Width in percentage for Grid Panel
    By Hari in forum 1.x Help
    Replies: 4
    Last Post: Jan 27, 2010, 4:35 PM
  4. Replies: 1
    Last Post: Jan 22, 2009, 5:46 AM
  5. Grid Panel Columns width in percentage
    By Rod in forum 1.x Help
    Replies: 0
    Last Post: Oct 03, 2008, 5:31 AM

Posting Permissions