Click here to Skip to main content
15,886,362 members
Articles / Web Development / HTML

A Simple in-page Pop Up Panel

Rate me:
Please Sign up or sign in to vote.
4.00/5 (2 votes)
19 Dec 2012CPOL2 min read 16K   7  
How to design a simple in-page pop up panel
//CdnPath=http://ajax.aspnetcdn.com/ajax/4.5/6/DetailsView.js
function DetailsView() {
    this.pageIndex = null;
    this.dataKeys = null;
    this.createPropertyString = DetailsView_createPropertyString;
    this.setStateField = DetailsView_setStateValue;
    this.getHiddenFieldContents = DetailsView_getHiddenFieldContents;
    this.stateField = null;
    this.panelElement = null;
    this.callback = null;
}
function DetailsView_createPropertyString() {
    return createPropertyStringFromValues_DetailsView(this.pageIndex, this.dataKeys);
}
function DetailsView_setStateValue() {
    this.stateField.value = this.createPropertyString();
}
function DetailsView_OnCallback (result, context) {
    var value = new String(result);
    var valsArray = value.split("|");
    var innerHtml = valsArray[2];
    for (var i = 3; i < valsArray.length; i++) {
        innerHtml += "|" + valsArray[i];
    }
    context.panelElement.innerHTML = innerHtml;
    context.stateField.value = createPropertyStringFromValues_DetailsView(valsArray[0], valsArray[1]);
}
function DetailsView_getHiddenFieldContents(arg) {
    return arg + "|" + this.stateField.value;
}
function createPropertyStringFromValues_DetailsView(pageIndex, dataKeys) {
    var value = new Array(pageIndex, dataKeys);
    return value.join("|");
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader Powercomp Software Sdn Bhd
Malaysia Malaysia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions