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";
    
  • 相关阅读:
    IOS编程之通讯录
    和iPhone有关的视图控制器:UIViewController、UITabBarController、UINavigationController及其混合用法
    跟大家分享下今天所学到的PHP,虽然很基础,但是感觉也很重要
    直接拿来用!最火的iOS开源项目
    ios各种手势,很有意思
    IOS中Json解析的四种方法
    [iOS]深入浅出 iOS 之多线程 NSThread
    IOS应用程序升级
    ios学习笔记之block在ios开发中的应用
    【热门收藏】iOS开发人员必看的精品资料(100个)——下载目录
  • 原文地址:https://www.cnblogs.com/frankzye/p/2026885.html
Copyright © 2011-2022 走看看