欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Extjs4.1.1 desktop动态加载桌面图标

程序员文章站 2024-01-17 14:43:34
...
    修改app.js:
        shortcuts: Ext.create('Ext.data.Store', {
            	//autoLoad:true,
                model: 'Ext.ux.desktop.ShortcutModel',
                proxy: {
    		    	type: 'ajax',
    		        url: 'desktopAction!createDesk.action',
    		        reader: {
    		            type: 'json',
    		            root: 'rows'
    		        }
    		    }
               /* data: [
                    { name: 'Grid Window', iconCls: 'grid-shortcut', module: 'grid-win' },
                    { name: 'Accordion Window', iconCls: 'accordion-shortcut', module: 'acc-win' },
                    { name: 'Notepad', iconCls: 'notepad-shortcut', module: 'notepad' },
                    { name: 'System Status', iconCls: 'cpu-shortcut', module: 'systemstatus'}
                ]*/
            })

 

在app.js下调用    
init: function() {
        // custom logic before getXYZ methods get called...

        this.callParent();
        
        this.desktop.shortcuts.load({
        });
        this.desktop.initShortcut();

    }

 

/**
 * 桌面快捷键
 *
 * @version sas-web v1.0
 * @author zhouhua, 2013-6-4
 */
@Entity
@Table(name="t_desktop")
public class Desktop {
    
    @Id
    private Integer did;
    private String name;
    private String iconCls;
    private String module;
    /**
     * @return the did
     */
    public Integer getDid() {
        return did;
    }
    /**
     * @param did the did to set
     */
    public void setDid(Integer did) {
        this.did = did;
    }
    /**
     * @return the iconCls
     */
    public String getIconCls() {
        return iconCls;
    }
    /**
     * @param iconCls the iconCls to set
     */
    public void setIconCls(String iconCls) {
        this.iconCls = iconCls;
    }
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return the module
     */
    public String getModule() {
        return module;
    }
    /**
     * @param module the module to set
     */
    public void setModule(String module) {
        this.module = module;
    }
    

}

 

相关标签: extjs desktop