Edit D:\rfid\libsystem\page\parameter\js\parameter_public.js
var controller_url;var controller_id;var operation;var datagrid_selector;var datagrid_param="";var datagrid_param_limit={};$(function(){setGridHeight();controller_id=$("#controller_id").val();if(controller_id.indexOf("/")>0){controller_url=base_path+controller_id+"/"}else{controller_url=base_path+"par/"+controller_id+"/"}datagrid_selector=$("#datagrid-single");if(datagrid_selector.length!=0){datagrid_selector.datagrid({onDblClickRow:updateRecord});if($("#libcode").length==1){datagrid_selector.datagrid({rowStyler:rowStylerLibcode,onSelect:onSelect})}}overLoadInitData()});function overLoadInitData(){var a=getInitJsonArray(getInitCodeArray("record"));_myPage.prototype.initData(a)}_myPage.prototype.onLoadSuccess=function(a,b){_fmtGridDataRows=a;loadGridData()};function loadGridData(){if(datagrid_selector.length==0){return}var a=datagrid_selector.datagrid("options");var c="list.do";if(a.pagination){c="page.do"}var b=0;var d=datagrid_selector.datagrid("getSelected");if(d){b=datagrid_selector.datagrid("getRowIndex",d)}datagrid_selector.datagrid({url:controller_url+c+datagrid_param,queryParams:datagrid_param_limit,onLoadSuccess:function(e){datagrid_selector.datagrid("selectRow",b);loadGridDataSuccess(e)},method:"post"})}function openWin(){cleanJsonData("record");$("#win").window("open")}function loadGridDataSuccess(a){}function closeWin(){$("#win").window("close")}function getRow(){var a=datagrid_selector.datagrid("getSelected");if(!a){openMessageDlg("??????????");return a}return a}function getPKCode(){if($("#id").length!=0){return"id"}if($("#code").length!=0){return"code"}var a=$('[primary-key="true"]');a.each(function(b,c){return c.id});return null}function getPK(a){return a[getPKCode()]}function getRowPK(){var b=getRow();if(!b){return}var a=getPK(b);if(!a){openMessageDlg("??????")}return a}function saveRecord(){var a=getJsonData(null,"record");if(!a){openMessageDlg("??????");return}if(verifyRequiredFields()){openMessageDlg("??????????????");return}if(verifyReasonableData(a)){return}var b=$('[insert-check="repeat"]');if(b.length>0){verifyRepeatData(a,b)}else{saveRecordOk(a)}}function saveRecordOk(a){var b=controller_url+operation;$.post(b,a,function(c){openMessageDlg(c.message);if(c.status=="0"){closeWin(c);loadGridData(c)}},"json")}function verifyRepeatData(b,c){var a=[{name:"???"},{bcvalue:"??????"}];var f=c[0].id;var d=controller_url+"page.do";var e={};e[f]=b[f];$.post(d,e,function(h){if(h.status=="0"&&h.rows.length>0){var k=h.rows[0];if(k.id&&b.id==k.id){saveRecordOk(b)}else{if(k.code&&b.code==k.code){saveRecordOk(b)}else{var j="";for(var g=0;g<a.length;g++){if(a[g][f]){j=a[g][f];break}}openMessageDlg(j+"?????,?????????!");return false}}}else{saveRecordOk(b)}},"json")}function verifyReasonableData(a){return false}function verifyRequiredFields(){var b=false;var a=$('[required="true"]');a.each(function(c,d){var e=d.id;if(e.indexOf("search_")<0){if(!getValue(e)){b=true;return false}}});return b}function insertRecord(){operation="insert.do";$("#saveRecord").linkbutton({disabled:false});_myPage.prototype.reSetToComboxItem(vLibcode);openWin();cancelCodeDisabled();getNextOrderCode()}function updateRecord(e,c){var b;if(!c){c=getRow()}if(isHigherLibcode(c.libcode)){$("#saveRecord").linkbutton({disabled:true});_myPage.prototype.reSetToComboxItem()}else{$("#saveRecord").linkbutton({disabled:false});_myPage.prototype.reSetToComboxItem(vLibcode)}operation="update.do";b=getPK(c);if(!b){return}openWin(c);var a=controller_url+"get.do";var d={pk:b};$.post(a,d,function(g){var f=g.rows[0];setJsonData(null,f);setCodeDisabled()},"json")}function setCodeDisabled(){var b=$('[get-code="true"]');if(b.length!=0){$("#code").textbox("textbox").attr("disabled",true)}var a=$('[update-readonly="true"]');if(a.length!=0){a.each(function(c,d){$("#"+d.id).textbox("textbox").attr("disabled",true)})}}function cancelCodeDisabled(){var b=$('[get-code="true"]');if(b.length!=0){$("#code").textbox("textbox").attr("disabled",false)}var a=$('[update-readonly="true"]');if(a.length!=0){a.each(function(c,d){$("#"+d.id).textbox("textbox").attr("disabled",false)})}}function deleteRecord(){var b=getRow();if(isHigherLibcode(b.libcode)){return openMessageDlg("?????????????????????!")}var a=getRowPK();if(!a){return}openConfirmDlg("???????????",null,deleteRecordOk,null)}function deleteRecordOk(){var b=getRowPK();var a=controller_url+"delete.do";var c={pk:b};$.post(a,c,function(d){openMessageDlg(d.message);if(d.status=="0"){loadGridData()}},"json")}function getNextOrderCode(){var a=$('[get-code="true"]');if(a.length==0){return}var b=base_path+"par/common/getNextOrderCode.do";var c={key:controller_id};$.post(b,c,function(d){if(d.status=="0"){setValue("code",d.rows[0])}else{openMessageDlg(d.message)}},"json")}function onGridShowTextBycode(d,c,b,e){if($("#"+d).length>0){if(!b){b="value"}e=!e?"text":e;var f=$("#"+d).combobox("getData");if(c){for(var a=0;a<f.length;a++){if(c==f[a][b]){return f[a][e]}}return c}else{return c}}return c}function setDatagridParam(){var a=$('[item-type="search"]');datagrid_param="";var b;a.each(function(c,d){b=getValue(d.id);if(!b){return true}if(datagrid_param.length==0){datagrid_param="?"}else{datagrid_param+="&"}datagrid_param+=d.id.replace("search_","")+"="+getValue(d.id)})}function searchRecord(){setDatagridParam();loadGridData()}function isLowerlibcode(b){var a=","+mystorage.get("lowerlibcode")+","+vLibcode+",";if(a.indexOf(","+b+",")>=0){return false}return true}function isHigherLibcode(b){if(!b){return false}var a=mystorage.get("completecode");if(!a||a.length<2){return false}a=","+a.substr(0,a.length-2);var c=b.indexOf("|");if(c>0){if(a.indexOf(","+b.substr(0,c)+",")>=0){return true}}else{if(a.indexOf(","+b+",")>=0){return true}if(b!=vLibcode){return true}}return false}function rowStylerLibcode(a,b){if(isHigherLibcode(b.libcode)){return"background-color:#aaa;"}}function onSelect(b,a){};
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de