source: trunk/web/addons/job_monarch/lib/extjs-30/examples/view/chooser-example.js @ 625

Last change on this file since 625 was 625, checked in by ramonb, 15 years ago

lib/extjs-30:

  • new ExtJS 3.0
File size: 729 bytes
Line 
1/*!
2 * Ext JS Library 3.0.0
3 * Copyright(c) 2006-2009 Ext JS, LLC
4 * licensing@extjs.com
5 * http://www.extjs.com/license
6 */
7Ext.onReady(function(){
8    var chooser, btn;
9
10    function insertImage(data){
11        Ext.DomHelper.append('images', {
12                tag: 'img', src: data.url, style:'margin:10px;visibility:hidden;'
13        }, true).show(true).frame();
14        btn.focus();
15    };
16
17    function choose(btn){
18        if(!chooser){
19                chooser = new ImageChooser({
20                        url:'get-images.php',
21                        width:515,
22                        height:350
23                });
24        }
25        chooser.show(btn.getEl(), insertImage);
26    };
27
28    btn = new Ext.Button({
29            text: "Insert Image",
30                handler: choose,
31        renderTo: 'buttons'
32    });
33});
Note: See TracBrowser for help on using the repository browser.