Apr 04, 2012, 3:06 PM
[CLOSED] ext:Window: Creating in JavaScript
Hi
There are any example how create a ext:window in javascript?
In link bellow, the examples are in ASP or C#:
https://examples2.ext.net/#/Window
I wish convert this function in Javascript:
There are any example how create a ext:window in javascript?
In link bellow, the examples are in ASP or C#:
https://examples2.ext.net/#/Window
I wish convert this function in Javascript:
Public Function getWindow(ByRef wndCfg As SuperaWeb.WindowCfg) As Ext.Net.Window
Dim wnd As New Ext.Net.Window
Dim loader As New Ext.Net.ComponentLoader
Dim btnExt As Ext.Net.Button
'Dim btnCfg As ButtonCfg
'Dim btnCfgJ As Newtonsoft.Json.Linq.JObject
'Dim i As Integer
loader.Url = wndCfg.Url
loader.Mode = Ext.Net.LoadMode.Frame
loader.LoadMask.ShowMask = True
loader.LoadMask.Msg = "Carregando..."
wnd.ID = Library.General.GetKey("window_")
wnd.Title = wndCfg.Title
If wndCfg.Icon <> "" Then
'ainda não sei como carregar um icon url via código
Else
wnd.Icon = Ext.Net.Icon.ApplicationForm
End If
wnd.AutoRender = False
wnd.Collapsible = False
wnd.Hidden = True
wnd.AutoRender = False
wnd.Maximizable = False
wnd.Modal = True
wnd.Loader = loader
wnd.Resizable = False
wnd.BodyPadding = 6
wnd.Constrain = True
wnd.CloseAction = Ext.Net.CloseAction.Destroy
wnd.Height = wndCfg.Height
wnd.Width = wndCfg.Width
wnd.Listeners.BeforeDestroy.Handler = wnd.ClientID & ".getBody().App.direct.BeforeDestroy();"
wnd.Listeners.BeforeDestroy.Delay = 1
'For i = 1 To wndCfg.Buttons.Count
For Each btnCfg In wndCfg.Buttons
'btnCfg = DirectCast(wndCfg.Buttons(i), ButtonCfg)
If TypeName(btnCfg) = "JObject" Then
btnExt = New Ext.Net.Button
btnExt.ID = Replace(btnCfg("ID").ToString, "[WINDOWID]", wnd.ID)
btnExt.Text = btnCfg("Text").ToString
btnExt.TextAlign = Ext.Net.ButtonTextAlign.Center
btnExt.Icon = btnCfg("Icon").ToString
btnExt.Listeners.Click.Handler = Replace(btnCfg("ClickHandler").ToString, "[WINDOWID]", wnd.ClientID)
btnExt.Listeners.Click.Delay = 1 'esta instrução foi passadas pelo Daniil para resolver alguns bugs nos javascripts.
btnExt.Hidden = CBool(btnCfg("Hidden").ToString)
Else
btnExt = New Ext.Net.Button
btnExt.ID = Replace(btnCfg.ID, "[WINDOWID]", wnd.ID)
btnExt.Text = btnCfg.Text
btnExt.TextAlign = Ext.Net.ButtonTextAlign.Center
btnExt.Icon = btnCfg.Icon
btnExt.Listeners.Click.Handler = Replace(btnCfg.ClickHandler, "[WINDOWID]", wnd.ClientID)
btnExt.Listeners.Click.Delay = 1 'esta instrução foi passadas pelo Daniil para resolver alguns bugs nos javascripts.
btnExt.Hidden = btnCfg.Hidden
End If
wnd.Buttons.Add(btnExt)
Next
wnd.Show()
Return wnd
End Function
Last edited by Daniil; Apr 04, 2012 at 4:41 PM.
Reason: [CLOSED]