PageSourceSearch

https://mindmuscle.net/script/InsertEditForms.js?v=80

js mindmuscle.net collected 2026-10-01 05:03:50 UTC 4,332 bytes, 123 lines download raw bytes

1//This script file contains reusable code for manipulating edit and insert forms
2
3function HideInsertEditForm(formClassName) {
4    //hide the form
5    $(formClassName).slideToggle('slow');
6    //make the div non modal again (exists on master page
7    $('#screen').fadeOut();
8}
9
10function ShowInsertEditForm(formClassName, isInsert) {
11    //if it is an insert hide the labels because we
12    //use empty messages instead
13    if (isInsert == true) {
14        $(formClassName).find('.labelDiv').hide();
15        $(formClassName).find('.updateButton').hide();
16        $(formClassName).find('.insertButton').show();
17    }
18    else {
19        $(formClassName).find('.labelDiv').show();
20        $(formClassName).find('.updateButton').show();
21        $(formClassName).find('.insertButton').hide();
22    }
23    
24    //set the css on a div (exists on master page) and set the popup to be moddle
25    $('#screen').css({ opacity: 0.5, 'width': $(document).width(), 'height': $(document).height() });
26    $('#screen').fadeIn();
27    //show the form popup
28    $(formClassName).slideToggle('slow');
29    
30}
31
32function ShowNonModalInsertEditForm(formClassName, isInsert) {
33    //if it is an insert hide the labels because we
34    //use empty messages instead
35    if (isInsert == true) {
36        $(formClassName).find('.labelDiv').hide();
37        $(formClassName).find('.updateButton').hide();
38        $(formClassName).find('.insertButton').show();
39    }
40    else {
41        $(formClassName).find('.labelDiv').show();
42        $(formClassName).find('.updateButton').show();
43        $(formClassName).find('.insertButton').hide();
44    }
45
46}
47
48//generic call to show and hide the ajax panel
49function ShowHideAjaxLoadingPanel(loadingPanelId, targetControlId, show) {
50   
51    if (show == true) {
52        $find(loadingPanelId).show(targetControlId);
53    }
54    else {
55        $find(loadingPanelId).hide(targetControlId);
56    }
57}
58
59//enable and disable the valitors so they don't fire when
60//the form is cleared
61function enableDisableValidators(enable, containerClass) {
62    //disable or enable all the validators
63    $(containerClass).find('.fieldValidator').each(function () {
64        this.enabled = enable;
65        $(this).parent(".control-group").attr("class", "control-group");
66        if (!enable) {
67            $(this).css("display", "none");
68        }
69    });
70}
71
72function SetValidatorStyles() {
73
74    $(".fieldValidator").each(function () {
75        if ($(this).css("display") == "none") {
76            $(this).parent(".control-group").attr("class", "control-group");
77        }
78        else {
79
80            $(this).parent(".control-group").attr("class", "control-group error");
81        }
82    });
83}
84
85function ConfirmItemDelete() {
86    return confirm('Are you sure you want to delete the record?');
87}
88
89
90/* Grid binding */
91//declare the required global variables
92var pageSize, sortExpressions, filterExpressions, sortExpressionsAsSQL, filterExpressionsAsSQL, currentPageIndex;
93function setValuesFromGrid(gridId) {
94
95    var sender = $find(gridId)
96    //get the pages size from the grid object
97    pageSize = sender.get_masterTableView().get_pageSize();
98    //get the sort expression from the grid object
99    sortExpressions = sender.get_masterTableView().get_sortExpressions();
100    //get the filter expressions from the grid object
101    filterExpressions = sender.get_masterTableView().get_filterExpressions();
102    //get the current page index from the grid object
103    currentPageIndex = sender.get_masterTableView().get_currentPageIndex();
104    //turn the sort expressions into a string for SQL
105    sortExpressionsAsSQL = sortExpressions.toString();
106    //turn the filter expressions into a string for SQL
107    filterExpressionsAsSQL = filterExpressions.toString();
108}
109
110//walks over all elements with the specified tag name inside our grid 
111//does not require registration, but is a bit more complex
112function GetGridServerElement(serverID, tagName, control) {
113    if (!tagName)
114        tagName = "*"; //* means all elements 
115    var elements = control.getElementsByTagName(tagName);
116    for (var i = 0; i < elements.length; i++) {
117        var element = elements[i];
118        if (element.id.indexOf(serverID) >= 0)
119            return element;
120    }
121}
122
123

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.