ext.net 在后台自定义增加 DesktopModule,codeBehind

Public Shared Sub ExtNetDesktop_CreateDeskTopIcon(ByRef objExtNetDesktop As Ext.Net.Desktop, ByVal strModuleName As String, ByVal strShortCutName As String, ByVal strIconCls As String, ByVal strHandler As String, Optional strLaunchIconCls As String = Nothing)
        Dim objMod As Ext.Net.DesktopModule
        Dim objShortCut As New Ext.Net.DesktopShortcut
        Dim blnFindMod As Boolean = False
        Dim i As Integer
        If objExtNetDesktop.Modules.Count > 0 Then
            For i = 0 To objExtNetDesktop.Modules.Count - 1
                If objExtNetDesktop.Modules(i).ModuleID = strModuleName Then
                    blnFindMod = True
                End If
            Next
        End If
        If blnFindMod = False Then
            objMod = New Ext.Net.DesktopModule
            objShortCut = New Ext.Net.DesktopShortcut
            objMod.ModuleID = strModuleName
            objShortCut.Name = strShortCutName
            objShortCut.IconCls = strIconCls
            objShortCut.Handler = strHandler
            'objShortCut.IconCls = "x-default-shortcut"
            'objShortCut.Handler = "function() {#{DirectMethods}.OrderPlatform();}"
            objMod.Shortcut = objShortCut
            objMod.Launcher = New Ext.Net.MenuItem
            objMod.Launcher.Text = strShortCutName
            objMod.Launcher.Handler = strHandler
            If Not strLaunchIconCls Is Nothing Then
                objMod.Launcher.IconCls = strIconCls
            End If

            'objMod.Launcher.DirectEvents.Click
            objExtNetDesktop.Modules.Add(objMod)
        End If
    End Sub




2  另外的简单例子

(1)  前台页面

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test3.aspx.vb" Inherits="prjTLECWeb.Test3" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <link href="Styles/desktop.css" rel="stylesheet" />
    <script>
        var tile = function () {
            Ext.ComponentQuery.query('desktop')[0].tileWindows();

        };

        var cascade = function () {
            Ext.ComponentQuery.query('desktop')[0].cascadeWindows();
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>

        <ext:Desktop ID="Desktop3y" runat="server">
           <Modules>
           </Modules>
        <DesktopConfig ShortcutDragSelector="true"  >
            <ShortcutDefaults IconCls="x-default-shortcut"  />
        </DesktopConfig>
        
            <StartMenu Title="Desktop 3Y" Height="300">
                <ToolConfig>
                    <ext:Toolbar ID="Toolbar1" runat="server" Width="100">
                        <Items>
                            <ext:Button ID="btnLogout" runat="server" Text="Logout" Icon="Key" />
                        </Items>
                    </ext:Toolbar>
                </ToolConfig>
            </StartMenu>
            <TaskBar TrayWidth="100">
            <CustomConfig>
                <ext:ConfigItem Name="startBtnText" Value="Start .NET" Mode="Value" />
            </CustomConfig>
            <QuickStart>
                <ext:Toolbar ID="Toolbar2" runat="server">
                    <Items>
                        <ext:Button ID="btnTitleWin" runat="server" Handler="tile" Icon="ApplicationTileVertical">
                            <QTipCfg Text="Tile windows" />
                        </ext:Button>

                        <ext:Button ID="btnCascade" runat="server" Handler="cascade" Icon="ApplicationCascade">
                            <QTipCfg Text="Cascade windows" />
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </QuickStart>
            </TaskBar>
        </ext:Desktop>
    </div>
    </form>
</body>
</html>

(2)后台页面


Imports Ext.Net
Public Class Test3
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objDesktopShortcut As New DesktopShortcut
        Dim objDesktopModule As New DesktopModule
        If Not IsPostBack Then
            Desktop3y.DesktopConfig.Wallpaper = "./Styles/wallpapers/window2.jpg"
        End If
        objDesktopShortcut.Name = "我的Module"
        objDesktopShortcut.IconCls = "x-default-shortcut"
        objDesktopModule.Shortcut = objDesktopShortcut
        objDesktopShortcut.Handler = "function() {#{DirectMethods}.ecItemOnHand2();}"
        objDesktopModule.ModuleID = "myModuleID"
        Desktop3y.Modules.Add(objDesktopModule)
    End Sub

End Class

阅读更多
文章标签: ext .net
个人分类: EXT.NET
上一篇EXT.NET应用例子,上传和下载图片及与数据库的交互
下一篇ext.net 在后台自定义在已经存在的Module 中加入一个窗体
想对作者说点什么? 我来说一句

几种Ext后台模板和网站后台模板

2012年04月16日 20.5MB 下载

没有更多推荐了,返回首页

关闭
关闭