zoukankan      html  css  js  c++  java
  • Infopath 2007 Core JS inside

    File Path:

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\INC

     

    What is Core.Js?

    1. Server Response Json
    2. Core.Js deserialize and serialize
    3. Core.Js Build Html
    4. Core.Js Catch Control Events

    Import Functions:

    Loading

    PostbackBody.OnLoad();
    

     

    Control Events

    a. ControlType:Button, TextBox, RadioButton…

    b. BaseType: BaseControl

    c. Functions: OnChange, OnFocus, OnClick….

    d. How To Use?

    var funcGetValueFromControl = BaseControl.FindFunction(objControl, "GetValueFromControl", false);
    var strFormattedValue = funcGetValueFromControl(objControl);
    

    How TO Know What Type Is The Control?

    var objSnippetElement = ViewDataNode_GetSnippetElement(objViewDataNode);
    
    var scriptClass = Snippet.GetScriptClass(objSnippetElement);
    
    scriptClass is a enum, such as “RadioButton”, “TextBox”..
    
    objSnippetElement is a array, contains HTML attributes
    

     

    General Functions

    ViewDataNode.OnControlChange //every control change or click or focus
    

     

    Add To Json

    Json is saving in a parameter “EventLog”.

    EventLog_AddPrivate( 0,objControl,objControl.id,
                                   "", //parent id
                                   "", //value
                                  false);
    

     

    PostBack

    View_SubmitForm(false, 0, 1, false); //note the paramenter for this function
    

    Dialogs

    Show Dialog:

    function showDialog(msg) {
        try {
            var enumDialog = "Progress";
            var arrDialogTemplate = Dialog.GetTemplate(enumDialog);
            var arrDialogInfo = Dialog.GetInfo(enumDialog);
            var strDialogName = DialogInfo.GetDialogName(arrDialogInfo);
            var enumPageBackGround = DialogInfo.GetPageBackgroundType(arrDialogInfo);
            Dialog.enumPageBackGround = enumPageBackGround;
            Dialog.arrDialogTemplate = arrDialogTemplate;
            var objDialog = document.getElementById("__DialogTable");
            if (objDialog != null) {
                if (objDialog.style.display != "block" || objDialog.style.zIndex == "-250") {
                    objDialog.style.display = "block";
                    objDialog.style.zIndex = "";
                } 
            }
            var objDialog = document.getElementById("__DialogContainer");
            arrDialogInfo[arrDialogTemplate[1]] = msg;
            objDialog.innerHTML = Dialog.RenderDialogTemplate(Dialog.arrDialogTemplate, arrDialogInfo);
            Dialog._RestoreSizeAndPosition();
            objDialog.style.display = "block";
        } catch (e) {  }
    }
    

    Hide dialog:

    Dialog._HideTable();
    
    var objDialog = document.getElementById("__DialogContainer");
    
    objDialog.style.display = "none";
    
  • 相关阅读:
    新概念4-38
    新概念4-37
    新概念4-36
    新概念4-35
    国史通鉴-03 天下为私 04
    新概念4-34
    西门子 框架断路器 及其他中低压配电设备资料查询
    OPC UA 的本质
    经典Scout添加等时同步设备
    同步报故障解同步启动
  • 原文地址:https://www.cnblogs.com/frankzye/p/2026885.html
Copyright © 2011-2022 走看看