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";

转载于:https://www.cnblogs.com/frankzye/archive/2011/04/25/2026885.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值