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

阅读更多
    修改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)