Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:21:45+00:00 2026-06-03T13:21:45+00:00

So I’ve recently found the disabled attribute in the Em.TextField, however I can’t seem

  • 0

So I’ve recently found the disabled attribute in the Em.TextField, however I can’t seem to re-enable the TextField after I’ve extended it with the disabled property set to true.

var app = Em.Application.create();
app.randomObj = Em.Object.create({
    temp: null
});
app.textField = Em.TextField.extend({
    valueBinding: 'app.randomObj.temp',
    disabled: true
});

How do I remove the disabled property with Ember?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:21:46+00:00Added an answer on June 3, 2026 at 1:21 pm

    There are some issues with your sample code, I’ll adress each one and hope I can clear some things up.

    Naming Convention

    First of all you should have a look at the Emberist post about naming conventions: Classes should be named UpperCase and instances lowerCase – exception for applications and namespaces. So in your provided JSFiddle in your comment it’s App.controller and App.ATextField.

    Declaring App as global variable

    You are creating an instance of an Ember.Application and assigning it to var app. Although you should be careful when using global variables, in this case you should define your application on the global namespace, so it should be App = Ember.Application.create(); respectively window.App = Ember.Application.create();. By declaring the app as global variable, you can use the powerful Bindings feature in your templates and your JS code.

    Bindings

    The bindings should be declared on instances and not on classes. By this I mean you wouldn’t define the valueBinding of your App.TextField in your class definition but rather move this to the concrete instance, for example in the template.

    In your provided JSFiddle in your comment your binding to the controller does not work because you don’t use one: to create a binding to a specific controller/object/… you’ll have to declare the property name you want to bind to and append a Binding String. So it would be disabledBinding: 'App.controller.shouldDisable'.


    Example

    I’ve refactored your code, see http://jsfiddle.net/pangratz666/pLpKV/:

    Handlebars:

    {{view Ember.TextField
        valueBinding="App.tempObj.hold"
        disabledBinding="App.controller.shouldDisable"}} {{App.tempObj.hold}}
    

    JavaScript:

    App = Em.Application.create();
    
    App.controller = Em.Object.create({
        shouldDisable: true
    });
    
    App.tempObj = Em.Object.create({
        hold: "initial value"
    });
    
    // just to illustrate how to define bindings outside of templates,
    // we're adding a TextField with bindings setup the same as for the
    // template
    Ember.TextField.create({
        valueBinding: 'App.tempObj.hold',
        disabledBinding: 'App.controller.shouldDisable'
    }).appendTo('body');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.