Results 1 to 2 of 2

Thread: Method to clear pre-filled data of a ST.future.Component

  1. #1

    Default Answered: Method to clear pre-filled data of a ST.future.Component

    Is there a way to clear an input field while using the ST.component("locator"); API?
    Using ST.component("locator").setValue(""); results in the following error:

    Code:
    TypeError: ST.component(...).setValue is not a function...

    PS: Was this forum down yesterday? Thought the announced transition to StackOverflow happend and just posted there.

  2. If it's an Ext JS field you will need to use the "ST.field" API, which has a "setValue" method. This method isn't available on the more generic "ST.component".

    Code:
    ST.field('myfield')
        .setValue('');
    If it's a normal input field (not an Ext JS component), then you can do the following:

    Code:
    ST.element('@myfield')
        .execute(function(field) {
            field.dom.value = '';
        });
    I haven't heard of any problems with the forums, perhaps it was just a temporary glitch. Some areas of the forums have been locked over the past month, as the transition over to StackOverflow is gradual. The Sencha Test forums are open for new topics/replies at the moment.

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    395
    Answers
    75

    Default

    If it's an Ext JS field you will need to use the "ST.field" API, which has a "setValue" method. This method isn't available on the more generic "ST.component".

    Code:
    ST.field('myfield')
        .setValue('');
    If it's a normal input field (not an Ext JS component), then you can do the following:

    Code:
    ST.element('@myfield')
        .execute(function(field) {
            field.dom.value = '';
        });
    I haven't heard of any problems with the forums, perhaps it was just a temporary glitch. Some areas of the forums have been locked over the past month, as the transition over to StackOverflow is gradual. The Sencha Test forums are open for new topics/replies at the moment.
    Daniel Gallo
    Sales Engineer
    Sencha

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •