Results 1 to 2 of 2

Thread: Custom Boolean Toggle for Editor Grid

  1. #1
    Ext User
    Join Date
    Mar 2008
    Posts
    9
    Vote Rating
    0
      0  

    Default 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 Attached Images

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      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.

Posting Permissions

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