16 $monLibrary= dirname(__FILE__) .
"/../library";
17 require_once(
"$monLibrary/cu_top.i");
18 require_once(
"$monLibrary/ck_hticket.i");
19 require_once(
"$monLibrary/monitorView.i");
20 require_once(
"$sharedLibrary/commonJsFunctions.i");
22 if (!CheckPerm($link, $Hu,
"cutrustdetail", $_SERVER[
'REMOTE_ADDR'])) {
25 header(
"Location: /hcuadm/hcu_noperm.prg");
30 $dataFile=
"cutrustdetail.data";
31 $dataPath=
"/hcuadm/$dataFile";
34 dms_import_v2($DATA_PARAMETERS,
"TOP_LEVEL", array(
"user_name" =>
"string"));
35 $cu= strtoupper($DATA_PARAMETERS[
"TOP_LEVEL"][
"user_name"]);
37 printMonitorPageTop(
"CU trust detail for $cu", $homecuKendoVersion, $cloudfrontDomainName);
45 .k-grid tbody .k-button {
46 min-width: 20px !important;
49 #defaultValueGrid thead { 53 #defaultValueGrid tbody tr { 57 #defaultValueGrid .k-grid-customDelete { 68 border-color: rgb(204, 204, 204);
69 background-color: rgb(238, 238, 238);
71 color: rgb(51, 131, 187) !important;
73 font-family:
'Trebuchet MS',
'Lucida Grande', Verdana, Arial, sans-serif;
78 #deleteDialogWindow .message { 82 #deleteDialogWindow .k-edit-buttons { 86 .k-context-menu .k-item, .k-context-menu {
87 width: 250px !important;
88 text-overflow: ellipsis;
91 .helpCell:hover, .k-grid-help:hover {
92 text-decoration: underline;
97 <script type=
"text/javascript">
101 getErrorsAreShownFunction();
102 getContextMenuForDoubleLevelGrid();
103 getAddMinifiedActionStyleFunction();
104 getParseCrudGridFunction();
105 getEscapeHTMLFunction();
106 getShowSQLFunction($showSQL);
107 getSetupValidatorInGridFunction();
108 getUseValidatorInGridFunction();
109 getShowWaitFunctions();
116 var dataItemToDelete=
null;
117 var detailRecords= [];
118 var trustedIdDetailDDLData= {};
122 var initialized=
false;
124 var grid= $(
"#grid").kendoGrid({
128 url:
"<?php echo $dataPath; ?>?operation=readTrustedVendors&cu=<?php echo $cu; ?>",
133 url:
"<?php echo $dataPath; ?>?operation=createTrustedId&cu=<?php echo $cu; ?>",
137 parameterMap:
function(data, type) {
141 else if (type =
"create")
149 trustedId: {type:
"string"},
150 hasMasterRecord: {type:
"boolean", defaultValue:
true},
151 masterDetailLength: {type:
"number"}
154 parse:
function (data)
157 if (data.operation ==
"read")
159 trustedIdDetailDDLData= data.trustedIdDetailDDL;
160 detailRecords= data.detailRecords;
161 $(
"#grid .k-grid-add").addClass(
"topLevel");
165 var availableTrustedIds= Object.keys(trustedIdDetailDDLData);
166 var gridData= grid.dataSource.data();
167 var trustedIdsInGrid= {};
168 for (var i=0; i!= gridData.length; i++)
169 trustedIdsInGrid[gridData[i].trustedId]=
true;
170 availableTrustedIds= $.grep(availableTrustedIds,
function (n,i) {
return typeof(trustedIdsInGrid[n]) ==
"undefined"; });
172 if (availableTrustedIds.length == 0)
173 $(
"#grid .k-grid-add.topLevel").hide();
175 $(
"#grid .k-grid-add.topLevel").show();
176 showWarnings(data,
"warningNotification");
179 if (data.operation ==
"read")
181 $(
"#invalidRequestServerSide").val(errorsAreShown(data,
"formValidateMainDiv"));
182 return data.topRecords;
186 $(
"#invalidRequestServerSide").val(errorsAreShown(data,
"formValidatePopupDiv"));
187 for(var i=0; i!= data.bottomRecords.length; i++)
189 detailRecords.push(data.bottomRecords[i]);
195 sort: {field:
"trustedId", dir:
"asc"}
198 {field:
"hasMasterRecord", hidden:
true},
199 {field:
"trustedId", title:
"Trusted ID",
200 template:
function (dataItem) {
201 if (dataItem.hasMasterRecord)
202 return dataItem.trustedId;
204 return "*** " + dataItem.trustedId +
" *** DO NOT USE: NO MASTER RECORD ***";
209 filterable: {extra:
false},
210 toolbar: [{name:
"create", text:
""}],
211 detailTemplate:
"<div class=\"detailGrid\"></div>",
212 detailInit:
function (eOuter) {
213 initDetailGrid(eOuter, trustedIdDetailDDLData[eOuter.data.trustedId]);
217 template: kendo.template($(
"#popupTemplate").html()),
221 title:
"Add Trusted Id",
226 edit:
function (eOuter) {
227 setupValidatorInGrid(eOuter,
false);
228 var availableTrustedIds= Object.keys(trustedIdDetailDDLData);
229 var gridData= grid.dataSource.data();
230 var trustedIdsInGrid= {};
231 for (var i=0; i!= gridData.length; i++)
232 trustedIdsInGrid[gridData[i].trustedId]=
true;
233 availableTrustedIds= $.grep(availableTrustedIds,
function (n,i) {
return typeof(trustedIdsInGrid[n]) ==
"undefined"; });
235 var trustedIdDDL= $(
"#nameDDL").kendoDropDownList({
237 data: availableTrustedIds
239 filter:
"startswith",
240 dataBound:
function () {
241 eOuter.model.trustedId= this.value();
242 eOuter.model.masterDetails= kendo.stringify(trustedIdDetailDDLData[this.value()]);
244 change:
function () {
245 eOuter.model.trustedId= this.value();
246 eOuter.model.masterDetails= kendo.stringify(trustedIdDetailDDLData[this.value()]);
248 }).data(
"kendoDropDownList");
250 save:
function (eOuter) {
251 useValidatorInGrid(eOuter,
false);
253 dataBound:
function () {
254 fullContextMenu.gridDatabound (
true, initialized, grid);
257 addMinifiedActionStyle(
"#grid",
true);
261 cancel:
function (eOuter) {
262 fullContextMenu.gridCancel(eOuter, grid,
true);
264 eOuter.preventDefault();
267 detailExpand:
function(e) {
268 $(e.detailRow).find(
".detailGrid").data(
"kendoGrid").dataSource.read();
270 }).data(
"kendoGrid");
272 fullContextMenu=
new getFullContextMenu(grid,
"contextMenu",
"trustedId",
"property");
274 fullContextMenu.setOptionFuncs(masterOptionFunc, detailOptionFunc, additionalSelectOptionFunc);
275 fullContextMenu.setDeleteOptions(
"<?php echo $dataPath; ?>",
"removeTrustedId&cu=<?php echo $cu; ?>",
"removeTrustedDetail&cu=<?php echo $cu; ?>",
function(isMaster, dataItemForDelete) {
278 var data= grid.dataSource.data().slice(0);
279 data= $.grep(data,
function(n,i) {
return n.trustedId != dataItemForDelete.trustedId; });
280 detailRecords= $.grep(detailRecords,
function(n,i) {
return n.trustedId != dataItemForDelete.trustedId; });
281 $(
".detailGrid:visible").each(
function () { $(
this).data(
"kendoGrid").dataSource.read(); });
282 grid.dataSource.data(data);
286 detailRecords= $.grep(detailRecords,
function(n,i) {
return n.trustedId == dataItemForDelete.trustedId && n.property == dataItemForDelete.property;},
true);
287 $(
".detailGrid:visible").each(
function () { $(
this).data(
"kendoGrid").dataSource.read(); });
289 },
function(dataItem) {
290 return $.grep(detailRecords,
function(n,i) { n.trustedId == dataItem.trustedId; }).length;
293 fullContextMenu.setLimitFromDatabound([
"click"]);
305 function masterOptionFunc(options, dataItem) {
306 options.push({text:
"Delete", cssClass:
"deleteLi"});
308 if (typeof(trustedIdDetailDDLData[dataItem.trustedId]) !=
"undefined")
310 var availableTrustedIds= Object.keys(trustedIdDetailDDLData[dataItem.trustedId]);
311 var gridData= $.grep(detailRecords,
function(n,i) {
return n.trustedId == dataItem.trustedId; });
312 var trustedIdsInGrid= {};
313 for (var i=0; i!= gridData.length; i++)
314 trustedIdsInGrid[gridData[i].property]=
true;
315 availableTrustedIds= $.grep(availableTrustedIds,
function (n,i) {
return typeof(trustedIdsInGrid[n]) ==
"undefined"; });
317 if (dataItem.hasMasterRecord && availableTrustedIds.length > 0)
319 options.push({text:
"Add detail", cssClass:
"addDetailLi"});
320 options.push({text:
"Pull unused master properties", cssClass:
"pullLi"});
335 function detailOptionFunc(options, dataItem) {
336 options.push({text:
"Delete", cssClass:
"deleteLi"});
337 var data= $.grep(detailRecords,
function(n,i) {
return n.trustedId == dataItem.trustedId; });
338 data.sort(
function(a,b) {
return a.displayOrder - b.displayOrder; });
340 if (data.length >= 2)
342 var moveBeforeChoices= [];
343 var moveAfterChoices= [];
345 for (var i=0; i!= data.length; i++)
347 moveBeforeChoices.push({text: data[i].property, cssClass:
"moveBeforeChoiceLi task_"+i});
348 moveAfterChoices.push({text: data[i].property, cssClass:
"moveAfterChoiceLi task_"+i});
349 if (data[i].property == dataItem.property)
353 if (data.length == 2)
355 this.taskIndex == 0 ? moveBeforeChoices= [] : moveBeforeChoices.splice(this.taskIndex, 1);
356 this.taskIndex == 1 ? moveAfterChoices= [] : moveAfterChoices.splice(this.taskIndex, 1);
360 moveBeforeChoices.splice(this.taskIndex, 2);
361 this.taskIndex == 0 ? moveAfterChoices.splice(0, 1) : moveAfterChoices.splice(this.taskIndex-1, 2);
364 if (moveBeforeChoices.length > 0)
365 options.push({text:
"Move before...", items: moveBeforeChoices, cssClass:
"moveBeforeLi"});
366 if (moveAfterChoices.length > 0)
367 options.push({text:
"Move after...", items: moveAfterChoices, cssClass:
"moveAfterLi"});
370 if (dataItem.hasMasterRecord)
372 options.unshift({text:
"Edit", cssClass:
"editLi"});
386 function additionalSelectOptionFunc(item, tr, grid, dataItem)
388 if ($(item).hasClass(
"pullLi"))
390 var popup= $(
"#pullDownPopup").data(
"kendoWindow");
391 var pullDownGrid= $(
"#pullDownGrid").data(
"kendoGrid");
392 var popupNoTemplates= $(
"#noTemplatesPopup").data(
"kendoWindow");
395 popup= $(
"<div id='pullDownPopup'></div>").kendoWindow({
397 template: kendo.template($(
"#pullTemplate").html())
400 title:
"Pull Down Properties",
406 }).data(
"kendoWindow");
408 popupNoTemplates= $(
"<div id='noTemplatesPopup'></div>").kendoWindow({
410 template: kendo.template($(
"#pullInNoTemplates").html())
413 title:
"No Templates",
419 }).data(
"kendoWindow");
421 pullDownGrid= $(
"#pullDownGrid").kendoGrid({
428 property: {type:
"string"},
429 value: {type:
"string"},
430 fieldType: {type:
"string"},
431 message: {type:
"string"}
437 {title:
"<input type='checkbox' id='allCheckbox'>",
template:
"<input type='checkbox' class='rowCheckbox'>", width:
"50px"},
438 {field:
"property", title:
"Property"},
441 }).data(
"kendoGrid");
443 $(
"#allCheckbox").click(
function () {
444 $(
".rowCheckbox").prop(
"checked", $(
this).prop(
"checked"));
449 $(
"#pullDownPopup .cancelBtn").click(
function () {
454 $(
"#noTemplatesPopup .okayBtn").click(
function () {
455 popupNoTemplates.close();
460 $(
"#pullDownPopup .okayBtn").off(
"click");
461 $(
"#pullDownPopup .okayBtn").on(
"click",
function() {
463 $(
".rowCheckbox:checked").each(
function () {
464 properties.push(pullDownGrid.dataItem($(
this).parent().parent()));
468 $.post(
"<?php echo $dataPath; ?>?operation=pullDownOptions&cu=<?php echo $cu; ?>", {trustedId: dataItem.trustedId, options: kendo.stringify(properties)},
function (data) {
472 if (!errorsAreShown(data,
"formValidatePullDownDiv"))
474 for (var i=0; i!= data.record.length; i++)
475 detailRecords.push(data.record[i]);
476 $(
".detailGrid:visible").each(
function () { $(
this).data(
"kendoGrid").dataSource.read(); });
482 var gridData= grid.dataSource.data();
483 var inMaster= trustedIdDetailDDLData[dataItem.trustedId];
488 var properties= $.grep(detailRecords,
function(n,i) {
return n.trustedId == dataItem.trustedId; });
489 for(var j=0; j!= properties.length; j++)
490 lookup[properties[j].property]=
true;
491 for (var prop in inMaster)
493 if (typeof(lookup[prop]) ==
"undefined")
494 data.push({property: prop, value: inMaster[prop].defaultValue, fieldType: inMaster[prop].fieldType, message: inMaster[prop].message});
499 $(
"#allCheckbox").prop(
"checked",
false);
500 pullDownGrid.dataSource.data(data);
501 popup.open().center();
505 popupNoTemplates.open().center();
508 else if ($(item).hasClass(
"moveAfterChoiceLi") || $(item).hasClass(
"moveBeforeChoiceLi"))
510 var classes= $(item).attr(
"class").split(/\s+/);
512 for(var i=0; i!= classes.length; i++)
514 var parts= classes[i].split(/_/);
515 if (parts[0].trim() ==
"task")
517 moveTaskId= Number(parts[1]);
522 if ($(item).hasClass(
"moveAfterChoiceLi"))
524 $.post(
"<?php echo $dataPath; ?>?operation=reorderProperties&cu=<?php echo $cu; ?>", {position: moveTaskId, trustedId: dataItem.trustedId, property: dataItem.property},
function (data) {
527 if (!errorsAreShown(data,
"formValidateMainDiv"))
529 detailRecords= $.grep(detailRecords,
function(n,i) {
return n.trustedId != dataItem.trustedId; });
530 for(var i=0, length= data.record.length; i!= length; i++)
532 detailRecords.push(data.record[i]);
534 grid.dataSource.read();
535 $(
"#grid").data(
"kendoGrid").expandRow($(tr).closest(
".k-detail-row").prev());
550 function showWarnings(data, warningNotification)
552 if (typeof(data.warning) !=
"undefined" && data.warning.length > 0)
554 var notification= $(
"#"+warningNotification).data(
"kendoNotification");
555 if (notification ==
null)
557 notification = $(
"<div id='"+warningNotification+
"'></div>").kendoNotification({
563 }).data(
"kendoNotification");
565 var warningLine=
"<b>Warnings:</b><br>";
566 for (var i=0; i!= data.warning.length; i++)
567 warningLine+= data.warning[i]+
"<br>";
568 notification.warning(warningLine);
581 function helpDataBound(grid, isCancel)
584 $(grid.tbody).find(
".k-grid-help").off(
"click mouseenter mouseleave");
585 $(grid.tbody).find(
".k-grid-help").on(
"click",
function () {
586 openHelpPopup($(
this), grid.dataItem($(
this).parent().parent()).message);
590 $(grid.tbody).find(
".k-grid-help").on(
"mouseenter",
function () {
591 $(
this).data(
"timer", setTimeout($.proxy(
function() { openHelpPopup($(
this), grid.dataItem($(
this).parent().parent()).message)}, $(
this)), 3000));
595 $(grid.tbody).find(
".k-grid-help").on(
"mouseleave",
function () {
596 clearTimeout($(
this).data(
"timer"));
610 function openHelpPopup(td, message)
612 clearTimeout($(td).data(
"timer"));
613 if ($(td).data(
"hasNotification") ==
true)
616 var notification= $(
"<div></div>").kendoNotification({
619 top: $(td).offset().top - $(
"body").scrollTop(),
620 left: $(td).offset().left - $(
"body").scrollLeft()
625 $(td).data(
"hasNotification",
true);
626 $(
".k-notification:last").mouseleave(
function () {
632 $(td).data(
"hasNotification",
false);
634 }).data(
"kendoNotification");
636 if (message ==
null || message ==
"")
637 notification.info(
"No help available");
639 notification.info(message);
651 function initDetailGrid(eOuter, fieldTypeDDLData)
653 var detailGridInitialized=
false;
654 var trustedId= eOuter.data.trustedId;
655 var detailGridSelector= eOuter.detailRow.find(
".detailGrid");
657 var nextDisplayOrderNum= $.grep(detailRecords,
function(n,i) {
return n.trustedId == trustedId; }).length;
659 var detailGrid= eOuter.detailRow.find(
".detailGrid").kendoGrid({
662 read:
function (options) {
663 options.success(detailRecords);
665 create:
function (options) {
667 var parameters= {trustedId: trustedId, property: options.data.property, value: options.data.value, fieldType: options.data.fieldType, message: options.data.message};
668 $.post(
"<?php echo $dataPath; ?>?operation=addTrustedDetail&cu=<?php echo $cu; ?>", parameters,
function(data) {
672 if (!errorsAreShown(data,
"formValidatePopupDetailDiv"))
674 data.record[0].displayOrder= nextDisplayOrderNum++;
675 options.success(data.record);
676 detailRecords.push(data.record[0]);
680 update:
function (options) {
682 var parameters= {trustedId: trustedId, property: options.data.property, value: options.data.value, fieldType: options.data.fieldType, message: options.data.message};
683 $.post(
"<?php echo $dataPath; ?>?operation=updateTrustedDetail&cu=<?php echo $cu; ?>", parameters,
function (data) {
686 if (!errorsAreShown(data,
"formValidatePopupDetailDiv"))
688 options.success(data.record);
697 pid: {type:
"number"},
698 property: {type:
"string"},
699 value: {type:
"string"},
700 fieldType: {type:
"string"},
701 hasMasterRecord: {type:
"boolean", defaultValue: eOuter.data.hasMasterRecord},
702 message: {type:
"string"},
703 trustedId: {type:
"string"},
704 displayOrder: {type:
"number"}
708 sort: {field:
"displayOrder", dir:
"asc"},
709 filter: {field:
"trustedId",
operator:
"eq", value: eOuter.data.trustedId}
713 template: kendo.template($(
"#popupTemplateDetail").html()),
723 {field:
"hasMasterRecord", hidden:
true, attributes: {
"class" :
"detailHasMasterRecord"}},
724 {command: [{className:
"k-grid-help k-info-colored", name:
"help", text:
"", iconClass:
"k-icon k-i-info"}], attributes: {
"class" :
"helpCell"}, width:
"50px"},
725 {field:
"property", title:
"Property"},
726 {field:
"value", title:
"Value"}
729 filterable: {extra:
false},
731 edit:
function (eInner) {
732 setupValidatorInGrid(eInner,
true);
734 var fieldType=
"string";
736 $(
"#valueTextInput").blur(
function () {
737 eInner.model.dirty=
true;
738 eInner.model.value= $(
this).val();
741 $(
"#valueBooleanInput").click(
function () {
742 eInner.model.dirty=
true;
743 eInner.model.value= $(
this).prop(
"checked") ?
"Y" :
"N";
746 var valueNumericInput= $(
"#valueNumericInput").kendoNumericTextBox({
747 change:
function () {
748 eInner.model.dirty=
true;
749 eInner.model.value= this.value();
751 }).data(
"kendoNumericTextBox");
754 var inEditCell=
false;
755 var valueGrid= $(
"#valueGrid").kendoGrid({
762 index: {type:
"number"},
763 value: {type:
"string"}
769 {field:
"index", hidden:
true},
770 {command: [{name:
"customDelete", text:
"", iconClass:
"k-icon k-i-delete", click:
function(e) {
771 eInner.model.dirty=
true;
772 getValueFromGrid(eInner, e, valueGrid,
true);
781 edit:
function (eGrid) {
782 if (eGrid.model.isNew())
783 eGrid.model.index= ++index;
785 save:
function (eGrid) {
786 eInner.model.dirty=
true;
787 getValueFromGrid(eInner, eGrid,
this,
false);
789 dataBound:
function () {
790 addMinifiedActionStyle(
"#valueGrid",
true);
792 }).data(
"kendoGrid");
794 if (eInner.model.isNew())
796 $(eInner.container).data(
"kendoWindow").title(
"Add Detail");
797 $(
"#propertyLabel").
remove();
799 var addedProperties= {};
800 var data= $.grep(detailRecords,
function(n,i) {
return n.trustedId == eOuter.data.trustedId; });
801 for (var i=0; i!= data.length; i++)
803 addedProperties[data[i].property]=
true;
807 for(var prop in fieldTypeDDLData)
809 if (typeof(addedProperties[prop]) ==
"undefined")
811 var r= fieldTypeDDLData[prop];
812 propertyDDL.push({fieldType: r.fieldType, defaultValue: r.defaultValue, propertyName: prop, message: r.message});
816 var propertyDDL= $(
"#propertyDDL").kendoDropDownList({
823 propertyName: {type:
"string"},
824 defaultValue: {type:
"string"},
825 fieldType: {type:
"string"},
826 message: {type:
"string"}
831 dataTextField:
"propertyName",
832 dataValueField:
"propertyName",
833 filter:
"startswith",
834 dataBound:
function (e) {
835 var dataItem= this.dataItem();
837 if (dataItem !=
null)
839 eInner.model.property= this.value();
840 eInner.model.fieldType= dataItem.fieldType;
841 eInner.model.message= dataItem.message;
842 fieldTypeChange(eInner, valueGrid, valueNumericInput, dataItem.fieldType,
true, dataItem.defaultValue);
846 change:
function (e) {
847 var dataItem= this.dataItem();
849 if (dataItem !=
null)
851 eInner.model.property= this.value();
852 eInner.model.fieldType= dataItem.fieldType;
853 eInner.model.message= dataItem.message;
854 fieldTypeChange(eInner, valueGrid, valueNumericInput, dataItem.fieldType,
true, dataItem.defaultValue);
858 }).data(
"kendoDropDownList");
862 $(eInner.container).data(
"kendoWindow").title(
"Update Detail");
863 $(
"#propertyDDL").
remove();
864 fieldTypeChange(eInner, valueGrid, valueNumericInput, eInner.model.fieldType,
false);
867 save:
function (eInner) {
868 useValidatorInGrid(eInner,
true);
870 dataBound:
function (eInner)
872 helpDataBound(
this,
false);
874 $(this.tbody).find(
"tr .detailHasMasterRecord:contains(true)").each(
function () {
875 $(
this).parent().find(
"td:not(.helpCell)").on(
"click",
function () {
876 fullContextMenu.gridForMenu= detailGrid;
877 fullContextMenu.dataItemForMenu= detailGrid.dataItem($(
this).parent());
878 fullContextMenu.rowForMenu= $(
this).parent();
879 detailGrid.editRow($(
this).parent());
884 cancel:
function (eInner) {
885 fullContextMenu.gridCancel(eInner,
this,
false);
887 $(this.tbody).find(
"tr td:not(.helpCell)").off(
"click");
888 $(this.tbody).find(
"tr .detailHasMasterRecord:contains(true)").each(
function () {
889 $(
this).parent().find(
"td:not(.helpCell)").on(
"click",
function () {
890 fullContextMenu.gridForMenu= detailGrid;
891 fullContextMenu.dataItemForMenu= detailGrid.dataItem($(
this).parent());
892 fullContextMenu.rowForMenu= $(
this).parent();
893 detailGrid.editRow($(
this).parent());
898 helpDataBound(
this,
true);
899 this.cancelChanges();
900 eInner.preventDefault();
903 }).data(
"kendoGrid");
905 fullContextMenu.addToDetailGrid (eOuter.data.trustedId, detailGrid);
919 function getValueFromGrid(eInner, eGrid, grid, isDeleting)
921 eInner.model.dirty=
true;
922 var data= grid.dataSource.data();
926 var deletingIndex= Number($(eGrid.target).closest(
"tr").find(
"td:eq(0)").text());
927 data= $.grep(data,
function(n,i) {
return n.index != deletingIndex; });
928 grid.dataSource.data(data);
931 for (var i=0; i!= data.length; i++)
933 if (!isDeleting && data[i].index == eGrid.model.index)
934 valueArray.push(eGrid.values.value);
936 valueArray.push(data[i].value);
938 eInner.model.value= kendo.stringify(valueArray);
954 function fieldTypeChange(eInner, valueGrid, valueNumericInput, newFieldType, updateModel, defaultValue)
959 $(
"#valueTextDiv").hide();
960 $(
"#valueBooleanDiv").hide();
961 $(
"#valueNumericDiv").show();
962 $(
"#valueListDiv").hide();
966 valueNumericInput.value(defaultValue);
967 eInner.model.value= defaultValue;
971 valueNumericInput.value(eInner.model.value);
973 valueNumericInput.focus();
976 $(
"#valueTextDiv").show();
977 $(
"#valueBooleanDiv").hide();
978 $(
"#valueNumericDiv").hide();
979 $(
"#valueListDiv").hide();
983 $(
"#valueTextInput").val(defaultValue);
984 eInner.model.value= defaultValue;
988 $(
"#valueTextInput").val(eInner.model.value);
990 $(
"#valueTextInput").focus();
993 $(
"#valueTextDiv").hide();
994 $(
"#valueBooleanDiv").show();
995 $(
"#valueNumericDiv").hide();
996 $(
"#valueListDiv").hide();
1000 if (defaultValue ==
"Y")
1002 $(
"#valueBooleanInput").prop(
"checked",
true);
1003 eInner.model.value=
"Y";
1007 $(
"#valueBooleanInput").prop(
"checked",
false);
1008 eInner.model.value=
"N";
1013 $(
"#valueBooleanInput").prop(
"checked", eInner.model.value ==
"Y");
1015 $(
"#valueBooleanInput").focus();
1018 $(
"#valueTextDiv").hide();
1019 $(
"#valueBooleanDiv").hide();
1020 $(
"#valueNumericDiv").hide();
1021 $(
"#valueListDiv").show();
1023 var valueDecoded= [];
1026 if (defaultValue !=
null && defaultValue !=
"")
1028 var value= defaultValue.replace(/\\
"/g, '"'); // unescape here so JSON is valid. 1029 valueDecoded= JSON && JSON.parse(value) || $.parseJSON(value); 1034 if (eInner.model.value != null) 1036 var value= eInner.model.value.replace(/\\"/g, '"'); // unescape here so JSON is valid. 1037 valueDecoded= JSON && JSON.parse(value) || $.parseJSON(value); 1042 for(var i=0; i!= valueDecoded.length; i++) 1044 gridData.push({index: i, value: valueDecoded[i]}); 1046 valueGrid.dataSource.data(gridData); 1051 $(document).ready(function () { 1056 <script id="deleteConfirmTemplate
" type="text/x-kendo-
template"> 1057 <div class="k-edit-form-container
"> 1058 <div class="container_12
"> 1059 <div class="grid_12 message
">Are you sure that you want to delete? 1060 <span class="removeDetailWarning
" style="display:none;
">There are <span>1</span> details that will be deleted as well.</span> 1063 <div class="k-edit-buttons k-state-
default"> 1064 <a class="k-button k-button-icontext deleteConfirmContinueBtn
" href="\#
"> 1065 <span class="k-icon k-i-check
"></span> 1068 <a class="k-button k-button-icontext deleteConfirmCancelBtn
" href="\#
"> 1069 <span class="k-icon k-i-cancel
"></span> 1075 <script id="pullTemplate
" type="text/x-kendo-
template"> 1076 <div id="formValidatePullDownDiv
" class="homecu-formStatus k-block k-error-colored
" style="display:none;
"></div> 1077 <div class="k-edit-form-container
"> 1078 <div class="container_12
"> 1079 <div id="pullDownGrid
"></div> 1081 <div class="k-edit-buttons k-state-
default"> 1082 <a class="k-button k-button-icontext okayBtn
" href="\#
"> 1083 <span class="k-icon k-i-check
"></span> 1086 <a class="k-button k-button-icontext cancelBtn
" href="\#
"> 1087 <span class="k-icon k-i-cancel
"></span> 1093 <script id="popupTemplate
" type="text/x-kendo-
template"> 1094 <div id="formValidatePopupDiv
" class="homecu-formStatus k-block k-error-colored
" style="display:none;
"></div> 1095 <form id="popupForm
" class="popupForm
" data-role="validator
" novalidate> 1096 <div class="container_12
"> 1097 <div class="grid_12
"> 1098 <div class="grid_4 alpha
"> 1101 <div class="grid_7
"> 1102 <div id="nameDDL
"></div> 1104 <div class="grid_1 omega
"> 1111 <script id="popupTemplateDetail
" type="text/x-kendo-
template"> 1112 <div id="formValidatePopupDetailDiv
" class="homecu-formStatus k-block k-error-colored
" style="display:none;
"></div> 1113 <form id="popupFormDetail
" class="popupForm
" data-role="validator
" novalidate> 1114 <div class="container_12
"> 1115 <div class="grid_12
"> 1116 <div class="grid_4 alpha
"> 1119 <div class="grid_7
"> 1120 <div id="propertyLabel
">#: property #</div> 1121 <div id="propertyDDL
"></div> 1123 <div class="grid_1 omega
"> 1127 <div class="grid_12
"> 1128 <div class="grid_4 alpha
"> 1129 <label>Value:</label> 1131 <div class="grid_7
"> 1132 <div id="valueTextDiv
" style="display: none;
"> 1133 <textarea class="k-input
" id="valueTextInput
" style="width: 100%; height: 100px
" row=15 col=40></textarea> 1135 <div id="valueBooleanDiv
" style="display: none;
"> 1136 <input type="checkbox
" id="valueBooleanInput
"> 1138 <div id="valueNumericDiv
" style="display:none;
"> 1139 <input id="valueNumericInput
"> 1141 <div id="valueListDiv
" style="display: none;
"> 1142 <div id="valueGrid
" style="width: 100%
"></div> 1145 <div class="grid_1 omega
"> 1152 <script id="pullInNoTemplates
" type="text/x-kendo-
template"> 1153 <div class="k-edit-form-container
"> 1154 <div class="container_12
"> 1155 <div class="grid_12 message
">There are no templates to add.</div> 1157 <div class="k-edit-buttons k-state-
default"> 1158 <a class="k-button k-button-icontext okayBtn
" href="\#
"> 1159 <span class="k-icon k-i-check
"></span> 1166 <?php printMonitorPageMiddle("CU trust detail
for $cu
", null, true); ?> 1168 <div id='hideSubmitWait' style='position:relative; left:-2000px;top:-2000px;'> 1169 <div id='homecuSubmitWait' class='k-block' > 1170 <div class='k-loading-image'></div> 1173 <input type="hidden
" id="invalidRequestClientSide
"> 1174 <input type="hidden
" id="invalidRequestServerSide
"> 1175 <div class="container_12
"> 1176 <div class="grid_12
"> 1177 <div class="grid_7 alpha omega
"> 1178 <div id="sqlOutput
"></div> 1181 <div class="grid_12
"> 1182 <div class="grid_7 alpha omega
"> 1183 <div id="formValidateMainDiv
" class="k-block k-error-colored
" style="display:none;
"></div> 1186 <div class="grid_12
"> 1187 <div class="grid_7 alpha omega
"> 1188 <div id="grid
" style="width:100%
"></div> 1193 <?php printMonitorPageBottom(); ?>