[CLOSED] Measure String Length

  1. #1

    [CLOSED] Measure String Length

    Hi,

    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 10:59 AM. Reason: [CLOSED]
  2. #2
    Hi,

    According to ExtJS docs:
    http://docs.sencha.com/ext-js/3-4/#!...method-measure
    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
    ComboBox1.getEl().dom
  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, 1:07 PM
  2. Replies: 1
    Last Post: Feb 28, 2011, 8:13 AM
  3. Replies: 4
    Last Post: Feb 01, 2011, 11:54 AM
  4. [CLOSED] TextFiled max length
    By Satyanarayana murthy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 29, 2009, 5:13 AM
  5. Replies: 3
    Last Post: Nov 12, 2008, 5:16 AM

Tags for this Thread

Posting Permissions