1. #1
    Ext User
    Join Date
    Mar 2008
    Posts
    9
    Vote Rating
    0
    Javiera is on a distinguished road

      0  

    Default Custom Boolean Toggle for Editor Grid

    Custom Boolean Toggle for Editor Grid


    Anyone interested in an iphone-style toggle? Perhaps for editor /property grids? I think it would be a neat alternative to a check or combo box. Thoughts?

    PHP Code:
    <html><head>
            <
    script type="text/javascript">
                
    Ext.onReady(function(){
                    var 
    toggle 'off';
                    var 
    tpl = {
                        
    on: new Ext.Template('<img src="btn_on.jpg">'),
                        
    off: new Ext.Template('<img src="btn_off.jpg">')
                    };
                    
    Ext.get("btn").on('click', function() {
                        
    tpl[toggle].overwrite('btn');
                        
    toggle = (toggle == 'on') ? 'off' 'on';
                    });
                });
            
    </script>
    </head>
    <body>
            <a id="btn"><img src="btn_off.jpg"></a>
    </body>
    </html> 
    Attached Images

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    You could modify the CSS for Ext.grid.CheckColumn and Ext.ux.form.Combobox to use these images.

    ps. The images are a bit large. They won't fit nicely into the Ext JS theme.

Thread Participants: 1

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