GRID form on the web (providing lock)

zhaozj2021-02-12  145

definegrid </ title> <meta http-equiv = content-type content = "text / html; charSet = GB2312"> <style type = text / css> body {font-size: 9pt } TD {font-size: 9pt;}. Header {border-right: # 555 1px solid: 4px; border-top: #fff 1px solid; padding-left: 4px; Background: #ccc; padding -bottom: 4px; overflow: hidden; border-left: #fff 1px solid; cursor: hand; padding-top: 4px; border-bottom: # 555 1px solid; white-space: noWrap} .Cell {border-right: #Ddd 1px solid; padding-right: 3px; border-top: #fff 1px solid; padding-left: 3px; background: #fff; padding-bottom: 3px; overflow: hidden; boder-left: #fff 1px solid; Padding-top: 3px; border-bottom: #ddd 1px solid; white-space: nowrap} </ stop></p> <p><script> // field title (column name # field width # data alignment) var header = new array (); for (iIndex = 0; IIndex <10; IIndex ) {header [IIndex] = "field" IINDEX "# 100 # left";} // field data (two-dimensional array) var Cellarray = new array (); for (IIndex = 0; IIndex <20; IIndex ) {var cell = new array (); for Kindex = 0; Kindex <10; Kindex ) {Cell [Kindex] = "line:" " KINDEX "> value ";} Cellarray [IIndex] = Cell;} </ script> <script> var GridWidth = 480; // Data table display width (excluding reel) Var showline = 10; // Data table Display column number var cellheight = 21; // Data column height var lockColumn = 1; // To lock the number of fields to lock (from left to right)</p> <p>Function WriteTable () {// Write Table Var IGridWidth = GridWidth; var newtml = "<Table Border = /" 0 / "Cellpadding = /" 0 / "Cellspacing = /" 0 / "> <TR> <TD> < Div style = / "width: 100%; overflow-x: scroll /"> <table border = / "0 /" cellpadding = / "0 /" cellspacing = / "0 /"> <tr> "; for (IIndex = 0; IIndex <header.Length; IIndex ) {if (IIndex <LockColumn) {var strheader = header [IINDEX] .split ("#"); IGridWidth- = strheader [1]; var lockinfo = ((IIndex 1 ) == LOCKCOLUMN? "Unlock": "Lock this field"; newhtml = "<td> <div class = /" header / "style = /" width: " strheader [1] " PX; Height : " CellHeight " PX / "Title = /" " LockInfo " / "οnclick = /" resettable (" IIndex ") / ">" strheader [0] "</ div> </ td>"; }} NEWHTML = "</ TR> <Tr> <TD Colspan = /" " LockColumn " / "> <div id = /" dataframe1 / "style = /" position: relative; width: 100%; overflow: hidden / "> <div id = /" datagroup1 / "style = /" position: relative / "> </ div> </ div> </ td> </ tr> </ table> </ div> </ td> <TD VALIGN = / "TOP /"> <div sty = / "width:" IGRIDWIDTH "PX; overflow-x: scroll /"> <table border = / "0 /" cellpadding = / "0 /" cellspacing = / "0 /"> <tr> "; for (iIndex = 0; IINDEX <Header.Length; IIndex ) {if (IIndex> = LockColumn) {var strheader =</p> <p>Header [iIndex] .split ("#"); newhtml = "<TD> <div class = /" header / "style = /" width: " strheader [1] " PX; Height: " CellHeight " PX / "Title = /" Lock this field / "οnclick = /" resettable (" IIndex ") / ">" strheader [0] "</ div> </ td>";}} newhtml = "< / TR> <TR> <TD colSpan = / " (header.Length-LockColumn) " / "> <div id = /" dataframe2 / "style = /" position: relative; width: 100%; overflow: hidden / "> <div id = /" datagroup2 / "style = /" position: relative / "> </ div> </ div> </ td> </ tr> </ table> </ div> </ td > <TD Valign = / "TOP /"> <div id = / "dataframe3 /" style = / "position: relative; background: # 000; overflow-y: scroll /" οnscrοll = / "sync_roll () /"> <div id = / "DataGroup3 /" style = / "position: relative; width: 1px; visibility: hidden /"> </ div> </ div> </ td> </ tr> </ table> "; defineGrid .innerhtml = newhtml; applydata ();</p> <p>Function ApplyData () {// Write data VAR newHTML = "<table border = /" 0 / "cellpadding = /" 0 / "cellspacing = /" 0 / ">"; for (IIndex = 0; IIndex <Cellarray. Length; IIndex ) {newhtml = "<tr>"; for (Kindex = 0; Kindex <header.length; kindex ) {Var strheader = header [kindex] .split ("#"); NEWHTML = "<TD> <div class = /" cell / "style = /" width: " strheader [1] " px; height: " cellheight " px; text-align: " strheader [2] "/"> " Cellarray [neyDex] [KINDEX] " </ div> </ td> ";}} newhtml =" </ tr> ";} newhtml =" </ table> "; DataGroup1.innerHTML = Newhtml; var newtml = "<table border = /" 0 / "cellpadding = /" 0 / "cellspacing = /" 0 / "; for (IIndex = 0; IIndex <CellarRay.Length; IIndex ) {newhtml =" <tr> "; for (Kindex = 0; Kindex <header.length; kindex ) {if (Kindex> = LOCKCOLUMN) {var strheader = header [Kindex] .split (" # "); newhtml =" <td> < Div class = / "cell /" style = / "width:" strheader [1] "PX; Height:" CellHeight "PX; Text-Align: strHeader [2] " / "> CELLARRAY [IIndex] [Kindex] "</ div> </ td>";}} newhtml = "</ tr>";} newhtml = "< / table> "; DataGroup2.innerhtml = newhtml; dataframe1.style.pixelheight = CellHeight * showline; dataframe2.style.pixelheight = CellHeight * Showline;</p> <p>DataFrame3.style.pixelHeight = CellHeight * ShowLine CellHeight; DataGroup3.style.pixelHeight = CellHeight * (CellArray.length 1);} function ResetTable (n) {var iGridWidth = 0; for (iIndex = 0; iIndex <Header. Length; IIndex ) {if (IIndex <(n 1)) {var strheader = header [IINDEX] .split ("#"); IGridWidth = PARSEINT (StrHeader [1]);}}}} (IGRIDWIDTH> gridwidth) { VAR SURE = confirm ("/ n lock field is greater than the width / N / N degrees displayed by the data sheet, which may cause the layout display abnormal ./N/N/N you determined to continue?");} Else {SURE = true;} f (sure) {lockColumn = (LockColumn == n 1)? 0: n 1; WriteTable ();}}</p> <p>Function sync_roll () {dataGroup1.style.postop = -dataframe3.scrolltop; datagroup2.style.postop = -dataframe3.ScrollTop;} Window.οnlοad = WRITETABLE; </ script></p> <p></ head> <body> <center> <Table Cellspacing = 0 cellpadding = 0 border = 0> <tr> <td style = "Border-Right: white 2px INSET; Border-top: White 2px INSet; border-left: White 2px INSET; Border-Bottom: White 2PX INSET; Background-Color: Scrollbar> <div id = definegrid> </ div> </ td> </ tr> </ table> </ center></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-6633.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="6633" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.051</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'HJzG_2BwA5TOZcAG5xd_2BgrPvePhRSVgiNix5doGs7_2F6s0v0yq1fZ7_2FgL5L08c22j9G8f6JPsPvPWcFNKzE7PgxJw_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>