コード例 #1
0
    // I know this method is obsolete, but i didn't find ahother place, where JSManager would work properly
    public override void RegisterClientScriptBlock(string key, string script)
    {
        base.RegisterClientScriptBlock(key, script);
        var renderer = JSManager.GetRenderer(this);

        JSManager.RegisterModule(renderer, typeof(PXChart), JS.AmChart);
        JSManager.RegisterModule(renderer, typeof(PXChart), JS.Chart);
    }
コード例 #2
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (!this.IsCallback)
     {
         var renderer = JSManager.GetRenderer(this);
         JSManager.RegisterModule(renderer, JS.BaseKey, JS.NetType);
     }
 }
コード例 #3
0
    private void RegisterModules()
    {
        IScriptRenderer scriptRenderer = JSManager.GetRenderer(this.Page);

        JSManager.RegisterSystemModules(this.Page);
        JSManager.RegisterCallbackModules(this.Page);
        JSManager.RegisterModule(scriptRenderer, typeof(PXTextEdit), JS.TextEdit);
        JSManager.RegisterModule(scriptRenderer, typeof(PXCheckBox), JS.CheckBox);
        JSManager.RegisterModule(scriptRenderer, typeof(PXDropDown), JS.DropDown);
    }
コード例 #4
0
    //---------------------------------------------------------------------------
    /// <summary>
    /// The page Init event handler.
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        if (!this.IsCallback)
        {
            var renderer    = JSManager.GetRenderer(this);
            var scriptFiles = new List <string>();
            PXContext.Session.PXSharedScriptFiles[JSManager.SharedScriptFilesKey] = scriptFiles;
            if (JSManager.GetBatchMode())
            {
                scriptFiles.AddRange(new string[] {
                    JS.BatchBase, JS.BatchEdit, JS.BatchGrid, AppJS.AppScriptBatch, AppJS.DashboardsBatch
                });
                JSManager.RegisterScriptBatch(renderer, JS.BaseKey, JS.BatchBase);
                JSManager.RegisterScriptBatch(renderer, JS.BaseKey, JS.BatchEdit);
                JSManager.RegisterScriptBatch(renderer, JS.BaseKey, JS.BatchGrid);
                JSManager.RegisterScriptBatch(renderer, AppJS.BaseKey, AppJS.AppScriptBatch);
                JSManager.RegisterScriptBatch(renderer, AppJS.BaseKey, AppJS.DashboardsBatch);
            }
            else
            {
                var list = new List <KeyValuePair <Type, string[]> >();
                list.Add(new KeyValuePair <Type, string[]>(JS.BaseKey, JS.BatchBaseFiles));
                list.Add(new KeyValuePair <Type, string[]>(JS.BaseKey, JS.BatchEditFiles));
                list.Add(new KeyValuePair <Type, string[]>(JS.BaseKey, JS.BatchGridFiles));
                list.Add(new KeyValuePair <Type, string[]>(AppJS.BaseKey, AppJS.BatchAppFiles));
                list.Add(new KeyValuePair <Type, string[]>(AppJS.BaseKey, AppJS.BatchDasboardFiles));

                foreach (KeyValuePair <Type, string[]> pair in list)
                {
                    foreach (string script in pair.Value)
                    {
                        JSManager.RegisterModule(renderer, pair.Key, script);
                        scriptFiles.Add(script);
                    }
                }
            }
        }

        this.project = this.Request.QueryString["Project"];
        if (!string.IsNullOrEmpty(this.project))
        {
            ProjectBrowserMaint.SelectProjectByName(this.project);
        }

        string screenID = this.Request.QueryString["EditScreenID"];

        if (!string.IsNullOrEmpty(screenID))
        {
            ProjectBrowserMaint.ContextScreenID = screenID;
        }

        base.OnInit(e);
    }
コード例 #5
0
    protected override void OnInitComplete(EventArgs e)
    {
        base.OnInitComplete(e);
        if (!string.IsNullOrEmpty(Request.QueryString["ctrl"]))
        {
            var renderer = JSManager.GetRenderer(this);
            JSManager.RegisterVar(renderer, this.GetType(), "fileLinkDialog", Request.QueryString["ctrl"]);
        }
        var graph = ds.DataGraph as UploadFileInq;        //.Views["SelectedScreen"].Cache;

        if (null != graph)
        {
            var cache = graph.FileDialog.Cache;
            if (null != cache && cache.Current != null)
            {
                var mode = cache.Current as PX.SM.FileDialog;
                if (null != mode)
                {
                    if (mode.Entity == null)
                    {
                        Guid g;
                        if (Guid.TryParse(Request.QueryString["note"], out g))
                        {
                            mode.Entity = g;
                        }
                    }
                    if (mode.Entity != null)
                    {
                        graph.Actions["GetFile"].SetVisible(false);
                        graph.Actions["GetFileLink"].SetVisible(false);
                        graph.Actions["DeleteFile"].SetVisible(false);
                    }
                    else
                    {
                        graph.Actions["AddLink"].SetVisible(false);
                        graph.Actions["AddLinkClose"].SetVisible(false);
                    }
                }
            }
            //if (fromFileDialog)
            //{
            //	graph.Actions["GetFile"].SetVisible(false);
            //	graph.Actions["GetFileLink"].SetVisible(false);
            //	graph.Actions["DeleteFile"].SetVisible(false);
            //}
            //else
            //{
            //	graph.Actions["AddLink"].SetVisible(false);
            //	graph.Actions["AddLinkClose"].SetVisible(false);
            //}
        }
        //var scrn = cache.Current as PX.Data.AttribParams;
    }