[CLOSED] Measure String Length

  1. #1

    [CLOSED] Measure String Length


    I'm trying to obtain string measure in pixels from a combo, and I find this function:
    Ext.util.TextMetrics.measure(combo, 'Text to measure length')
    But it throw an exception:
    No se puede obtener valor de la propiedad 'fontSize': el objeto es nulo o está sin definir (Can not get value of property 'fontSize': the object is null or undefined)

    It seems the problem is in Ext.fly(combo).getStyles function that is called internally

    There is any workaround for this function or I'm doing something wrong?
    Last edited by Daniil; Mar 05, 2012 at 11:59 AM. Reason: [CLOSED]
  2. #2

    According to ExtJS docs:
    the first argument must be:
    The element, dom node or id from which to copy existing CSS styles that can affect the size of the rendered text
  3. #3
    If combo is an instance of Ext.combobox, what I have to pass to the function?

    combo.getEl() ?
  4. #4
    I think
  5. #5
    Thanks this was my mistake

Similar Threads

  1. [CLOSED] integers length
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 02, 2011, 2:07 PM
  2. Replies: 1
    Last Post: Feb 28, 2011, 9:13 AM
  3. Replies: 4
    Last Post: Feb 01, 2011, 12:54 PM
  4. [CLOSED] TextFiled max length
    By Satyanarayana murthy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 29, 2009, 6:13 AM
  5. Replies: 3
    Last Post: Nov 12, 2008, 6:16 AM

Tags for this Thread

Posting Permissions