Results 1 to 3 of 3

Thread: [CLOSED] Proplem creating Ext.form.Text using markup

  1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
      0  

    Default [CLOSED] Proplem creating Ext.form.Text using markup

    I try to create a TextBox using markup. But not successful.
    I have a very simple mytest.html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Test</title>
        <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
        <script type="text/javascript" src="ext-core-debug.js"></script>
        <script type="text/javascript" src="ext-all-debug.js"></script>
        <script type="text/javascript" src="test.js"></script>
    </head>
    <body>
        <input type='text' id='myText'/>
    </body>
    </html>
    And test.js is
    Code:
    Ext.require([
        'Ext.form.*'
    ]);
    
    Ext.onReady(function() {
        var myText = new Ext.form.Text({width:100, value: 'Hello world'});
        myText.applyToMarkup('myText');
    });
    Please help.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Looks like it's a bug with Ext.Component.

    This worked for this simple test, not sure if it will still work in all cases:

    Code:
    Ext.override(Ext.Component, {
    	applyToMarkup: function(el) {
    		el = Ext.get(el);
    		el.addCls("x-hidden");
    		this.allowDomMove = false;
    		this.render(el.dom.parentNode, null, true);
        }
    });
    Ext.require([
    	'Ext.form.*'
    ]);
    Ext.onReady(function() {
    	var myText = new Ext.form.Text({hideLabel: true, width: 100, value: 'Hello world'});
    	myText.applyToMarkup('myText');
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    11
      0  

    Default

    Ext 4 is not going to support applyTo functionality for components. This was done in order to facilitate new theming capabilities such as border radius on all components on all browsers. The existing code was slated for deprecation and won't be part of the next release.

Similar Threads

  1. creating from markup
    By shay in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 26 Jan 2009, 5:16 PM
  2. Need help creating a grid from markup with pagination
    By svaddey in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 11 Mar 2008, 9:11 AM
  3. creating forms from markup
    By jdfergason in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 21 Jan 2008, 12:58 PM
  4. form submitting combobox proplem
    By hermeslm in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 14 Nov 2007, 8:51 AM
  5. [Ext 2.0] [Solved] Creating panel from existing markup
    By sfwalter in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 6 Sep 2007, 6:27 PM

Posting Permissions

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