Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5051 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|  sdk_details.asp
5
'|  Edit an SDK Version
6
'|
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<%
20
'------------ ACCESS CONTROL ------------------
21
%>
22
<!--#include file="_access_control_general.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim parSdkTag_id
26
 
27
'------------ Constants Declaration -----------
28
'------------ Variable Init -------------------
29
parSdkTag_id = Request("sdktag_id")
30
if parSdkTag_id = "" Then parSdkTag_id = 0
31
%>
32
<script language="JavaScript" type="text/javascript">
33
//# sourceURL=sdk_details.asp
34
function setInfo(txt) {
35
$("#info").text( txt);
36
}
37
 
38
//  Configure the Summary Table
39
$('#sdk_content').DataTable({
40
    deferRender: true,
41
    dom: "frtiS",
42
    sScrollY: $( document ).height() - 255,
43
    scrollCollapse: true,
44
    processing: true,
45
    retrieve:true,
46
    serverSide: true,
47
    ajaxSource: "sdk_content_json.asp",
48
    "fnServerParams": function ( aoData ) {
49
        aoData.push( { "name": "sdktag_id", "value": <%=parSdkTag_id%> } );
50
    },
51
    "ordering": true,
52
    "order": [[ 1, "asc" ]],
53
 
54
     "columns": [
55
        { "data": "PV_ID" },
56
        { "data": "PKG_NAME" },
57
        { "data": "PKG_VERSION" },
58
        { "data": "SDKPKG_CHECK" },
59
    ],
60
 
61
    //"columnDefs" : [ 
62
    //    {"visible" : false, "targets" : [0]},
63
    //    ],
64
 
65
    });
66
 
67
//  Process each row of table data before it is presented to the table scroller
68
//  Process the raw Ajax data
69
//      Create a checkbox for the state
70
//      Add a data item to the entry - to allow traceback when saving
71
$('#sdk_content')
72
    .on('xhr.dt', function ( e, settings, json ) {
73
        json.aaData.forEach(function(row){
74
            var checked = row.SDKPKG_STATE == "E" ? 'checked' : '';
75
            row.SDKPKG_CHECK = '<input type="checkbox" class=clickable '+ checked +' data-pvid='+ row.PV_ID +'>';
76
        });
77
    } );
78
 
79
// Process click on checkboxes within the datatable
80
//      this - a DOM node
81
//      $(this) - The jquery wrapped node
82
//
83
$('#sdk_content').on( 'click', 'tbody td :checkbox', function () {
84
setInfo("checked:" +  this.checked + ", pvid:" + $(this).data('pvid'));
85
 
86
var table = $('#sdk_content').DataTable();
87
var row = $(this).closest('tr');
88
var d = table.row( row ).data();
89
 
90
 
91
        $("#progressBar").css('visibility', 'visible');
92
        $.ajax(
93
        {
94
            url : 'sdk_opr_json.asp',
95
            type: "POST",
96
            data : { action : 'setSdkContentState', sdktagId : <%=parSdkTag_id%>, pv_id : $(this).data('pvid'), sdkpkg_state : this.checked ? 'E' : '-' },
97
            dataType : "json",
98
            cache: false,
99
            success:function(data, textStatus, jqXHR)
100
            {
101
                //data: return data from server
102
                //console.log ("UpdateData", data);
103
                if (data.result != 0)
104
                {
105
                    setInfo("Error:" + ((data.error != 0) ? data.emsgSummary : "Reason not given"));
106
                    //if (data.error >= 0) disableForm();
107
                    return;
108
                }
109
                //  call user success function
110
                //success(data);
111
            },
112
            error: function(jqXHR, textStatus, errorThrown)
113
            {
114
                setInfo("Error:" + errorThrown);
115
                //disableForm();
116
                //if fails
117
            },
118
            complete : function()
119
            {
120
                $("#progressBar").css('visibility', 'hidden');
121
            }
122
        });
123
    } );
124
    </script>
125
<table id=main_section class="full_table">
126
  <!-- Section Header ---->
127
  <tr>
128
     <td nowrap class="form_ttl">DON'T KNOW YET</td>
129
  </tr>
130
 
131
  <!-- Section Body ---->
132
  <tr>
133
  <td>
134
    <div class="rounded_box">
135
      <table id=sdk_content class="full_table" >
136
          <thead>
137
          <tr class="body_col form_align">
138
            <th width="1%"> PV_ID
139
            <th width="10%"> Package Name
140
            <th> Package Version
141
            <th width="1%"> State
142
          </thead>
143
      </table>
144
 
145
      <!-- Info / Ajax Progress bar -->
146
      <div class='bg_dialog body_txt' style='position:relative;min-height:1em;' >
147
          <img id='progressBar' style='visibility:hidden;position: absolute' src='icons/i_processing.gif' width='79' height='14'>
148
          <div id=info  style='position: absolute;'></div>
149
      </div>
150
 
151
    </div>
152
</table>