1. #21
    Sencha User
    Join Date
    Mar 2007
    Posts
    186
    Vote Rating
    0
    Nullity is on a distinguished road

      0  

    Default


    Quote Originally Posted by devnull View Post
    I did have to make a small modification though, to prevent the button from being wiped out with a form.reset():
    ...
    (new config option disableReset)
    Ah, good idea, I didn't even consider that. If you don't mind, I think I'll add that in.

  2. #22
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    Have at it
    If you can think of a better way to implement it than my quick hack, more power to ya!

  3. #23
    Sencha User
    Join Date
    Mar 2007
    Posts
    186
    Vote Rating
    0
    Nullity is on a distinguished road

      0  

    Default


    Here is what I added:

    Code:
        /**
         * Resets the current field value to the originally-loaded value
         * @param {Boolean} force Force a reset even if the option disableReset is true
         */
        reset : function(force){
            if(!this.disableReset || force === true){
                this.setRawValue(this.originalValue);
            }
        },
    This way, it allows you to still force a reset manually (as opposed to a form reset) by passing 'true', if the 'disableReset' option is set.

    Like so:

    Code:
    miscfield.reset(true);

  4. #24
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    173
    Vote Rating
    0
    MaxT is on a distinguished road

      0  

    Question A small question.

    A small question.


    Hello Nullity, just taking a look at your extension and have a question about the setSize method.


    PHP Code:
        /**
         * Sets the height and width of the field
         * @param {Number} width The new field width in pixels
         * @param {Number} height The new field height in pixels
         */
        
    setSize : function(wh){
            if(!
    this.rendered || !this.el){
                
    this.width w;
                
    this.height h;
                return;
            }
            if(
    w){
                
    this.el.setWidth(w);
            }
            if(
    h){
                
    this.el.setHeight(h);
            }
            var 
    this.el.dom.offsetHeight// force browser recalc
        
    }, 
    In this there is a minor error (gives a Javascript warning) in that the input parameter "h" is redeclared as "variable h" at the end. I assume that either the "var" part could be removed, or it could be changed to "var h2" and still have the same effect.

    Can you expand a bit on what the comment for this line means? I assume that just having the line causes the browser (all of them, or is this browser specific?) to recalculate the height?

    Thanks,

    Max

  5. #25
    Sencha User
    Join Date
    Mar 2007
    Posts
    186
    Vote Rating
    0
    Nullity is on a distinguished road

      0  

    Default


    That 'setSize' method was actually ripped straight from Field.js from Ext 1.0. I just updated the first post with totally refactored code based off of Ext 1.1.1, so this should no longer be a problem.

  6. #26
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    173
    Vote Rating
    0
    MaxT is on a distinguished road

      0  

    Default 1.1.1 update

    1.1.1 update


    I've tried out the new version, seems to work fine for me.


    In one case, I have labels aligned at the top and I'm using this code to create a MiscField:

    PHP Code:
            f.column(
                {
    width54labelSeparator""},
                
                new 
    Ext.form.MiscField(
                    {
                        
    fieldLabel" ",
                        
    value"From:",
                        
    id"t-date-from-title",
                        
    cls"x-form-miscfield-text",
                        
    width50
                    
    }
                )
            ); 
    The additional CSS is:
    PHP Code:
    .x-form-miscfield-text {
    padding3px 0;

    This column is followed by another column that contains a standard ComboBox.

    With the simple CSS I've given above the "From:" text lines up vertically with the ComboBox text in Fx2, but is 1px too high in IE.

    Has anyone got their head round making the alignment perfect in both IE and Fx?

    Admittedly, the difference is very hard to spot (jpg attached of IE7 screen capture) and I'm happy to let it stay as it is, but if anyone has a better solution that would be even better.

    Thanks,

    Max
    Attached Images

  7. #27
    Ext User
    Join Date
    Dec 2007
    Posts
    17
    Vote Rating
    0
    Roger BORDEAUX is on a distinguished road

      0  

    Default


    Hi Nullity,

    Does your extension be compatible with Ext 2.0 ?

    I have the following source that give me the error :

    this.el has no properties
    http://localhost/conference/js/ext/ext-all.js
    Line 58

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<title>Untitled Document</title>
        <!-- GC -->
        <!-- LIBS -->
        <link rel="stylesheet" type="text/css" href="../js/ext/resources/css/ext-all.css"/>
        <script type="text/javascript" src="../js/ext/adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="../js/ext/ext-all.js"></script>
    
        <script type="text/javascript" src="../js/ext-extension/MiscField.js"></script>
        <link rel="stylesheet" type="text/css" href="../js/ext-extension/MiscField.css"/>
    
        <!-- ENDLIBS -->
    
    
    		<script type="text/javascript">
    
    		Ext.onReady(init);
    
    		function init() {
    
    	    var myForm = new Ext.FormPanel({
    	        url:'save-form.php',
    	        frame:true,
    	        title: 'Simple Form',
    	        bodyStyle:'padding:5px 5px 0; ',
    	        width: 600,
    					height : 500,
    	        defaultType: 'textfield',
    					collapsible : true, 	
    	        waitMsgTarget: true
    
    				});		
    
    			myForm.add(new Ext.form.TextField({
    				 name : 'first'
    				,fieldLabel : 'Firstname' 
    				,labelSeparator : ''
    				,id : 'first'
    				,width : 150
    			}));
    
    			myForm.add(new Ext.form.MiscField({
    				fieldLabel: 'MiscField',
    				id : 'fieldLabel',
    				value: 'Test value'
    			}));
    				
    	    myForm.render(Ext.get('myElem'));
    
    		}
    		</script>
    	</head>
    	<body>
    		<div id="myElem"></div>
    	</body>
    </html>
    Best regards

    Roger

  8. #28
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    173
    Vote Rating
    0
    MaxT is on a distinguished road

      0  

    Default MiscField for 2.0

    MiscField for 2.0


    I don't think it is compatible with Ext 2.0.

    A similar extension is Ext.ux.StaticTextField:
    http://extjs.com/forum/showthread.php?t=20992

    Has the advantage that you can choose to add a hidden field to submit the field. However, it does some things differently, like automatically encoding the value when you call setValue. Not so sure this is a good idea.

    I found a bug with MiscField in that getName doesn't work. Here is my workaround.

    PHP Code:
        /**
         * Returns the name attribute of the field if available, otherwise the hiddenName if
         * available. Returns a null string if neither are available.
         * 
         * @return {String} name The field name or hiddenName.
         */
        
    getName: function(){
            
    //return this.rendered && this.el.dom.name ? this.el.dom.name : (this.hiddenName || '');
            // NB: "name" is applied to a div, hence you must use hasAttribute and getAttribute.
            // Can't access it as el.dom.name as you would for an input element.
            
    var '';
            if ( 
    this.rendered && this.el.dom.hasAttribute("name") ) {
                
    this.el.dom.getAttribute("name");
            } else if (
    this.hiddenName) {
                
    this.hiddenName;
            }
            return 
    n;
        }, 

  9. #29
    Ext User
    Join Date
    May 2008
    Posts
    7
    Vote Rating
    0
    amoghadam is on a distinguished road

      0  

    Default C is NULL

    C is NULL


    I have gotten a JS error saying C is NULL. I have added both the css file and the js file in the order specified.

    Please help.
    Thanks

  10. #30
    Sencha User Mjollnir26's Avatar
    Join Date
    Oct 2008
    Location
    Germany
    Posts
    152
    Vote Rating
    0
    Mjollnir26 is on a distinguished road

      0  

    Default


    Removing the "applyTo" - Method from Nullity's SourceCode made this cool little thing work for me on Ext 2.2

    Not totally sure if that won't break anything though.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar