JARG Posted May 30, 2019 Share Posted May 30, 2019 var cellarray = ["SO_ID","SALES_DOCUMENT","ITEM",...] function prepColorChange(obj, current_color){ objid = obj.id; objindex = objid.slice(objid.lastIndexOf("_")+1, objid.length); var to_color = "lightblue"; if(current_color == "lightblue") { to_color = "transparent" } for (var i=0; i < cellarray.length; i++) { var cell_name = "GRIDVIEW_" + cellarray + "_" + objindex; document.getElementById(cell_name).style.backgroundColor = to_color; }} 1 Link to comment Share on other sites More sharing options...
custom55 Posted May 31, 2019 Share Posted May 31, 2019 (edited) I was a mainframe coder for many years ( since 1977 ) and PL/1 was the sh1t for programming arrays. Also wrote assembler and COBOL code that handled intense array processing. Wall Street trading systems. Some of the code I wrote in the 80s and 90s is still functioning. I'm retired. Edited May 31, 2019 by custom55 4 Link to comment Share on other sites More sharing options...
HemiBeers Posted May 31, 2019 Share Posted May 31, 2019 (edited) C# correct? Death by curly brackets. ;) I start to learn c# off and on but didn't have current demands at my jobs for it. First cut my programming teeth on Cobol on a PC out of college in 84. Cobol actually wasn't too bad. Hated RPG. I did vb6 programming at my last job I left about 7 years ago. they still used vb6 although it was 'obsolete'. I'm still seeing demand for programmers for maintaining vb6 legacy systems. If a system works well and there's no need to 'modernize', then companies will find a way to keep it running. They still run a Document Management System I wrote and posted screen shots of it on their website. I really didn't think too much of the system. An HR manager I worked with back in the 90s contacted me to see if I still had the Attendance System that he could buy from me. Um, no traces of that left and no I don't want to re-do it thanks. Hard to kill off old code if it works and still fits the needs. Edited May 31, 2019 by HemiBeers 1 Link to comment Share on other sites More sharing options...
Relayer2112 Posted May 31, 2019 Share Posted May 31, 2019 It looks like javascript to me. 1 Link to comment Share on other sites More sharing options...
JARG Posted May 31, 2019 Author Share Posted May 31, 2019 C# correct? Death by curly brackets. ;) While there is plenty of C# elsewhere on the page, that bit is javascript. 1 Link to comment Share on other sites More sharing options...
JARG Posted May 31, 2019 Author Share Posted May 31, 2019 I have a page that displays a table around 45 columns wide. The client wanted a way to highlight the row he intended to work on, similar to clicking the row number in Excel. The array contains a list of all the column IDs in the table and clicking the first cell on the table executes the function, which iterates through the array and sets background color of each cell in the row. 2 Link to comment Share on other sites More sharing options...
HemiBeers Posted May 31, 2019 Share Posted May 31, 2019 I have a page that displays a table around 45 columns wide. The client wanted a way to highlight the row he intended to work on, similar to clicking the row number in Excel. The array contains a list of all the column IDs in the table and clicking the first cell on the table executes the function, which iterates through the array and sets background color of each cell in the row.Very Cool. My current job is more support and no real programming stuff, which I'd prefer to do. Some occasional scripting but that's it. But it pays pretty good and I'm a good whore who does what they're told. 1 Link to comment Share on other sites More sharing options...
grep Posted May 31, 2019 Share Posted May 31, 2019 (edited) I was a mainframe coder for many years ( since 1977 ) and PL/1 was the sh1t for programming arrays. Also wrote assembler and COBOL code that handled intense array processing. Wall Street trading systems. Some of the code I wrote in the 80s and 90s is still functioning. I'm retired. Not retired. However have a number of COBOL/DB2 programs doing trade settlement, funding projections, and back office reconciliation, still in production. Taking a hint from C/C++ dynamically sized arrays, I came up with a way to do variable length tables in IBM COBOL. The syntax was butt ugly, but the code worked. ;) I suppose I could have done the same with ODO's for arrays. Never tried. Edited May 31, 2019 by grep Link to comment Share on other sites More sharing options...
grep Posted May 31, 2019 Share Posted May 31, 2019 var cellarray = ["SO_ID","SALES_DOCUMENT","ITEM",...] function prepColorChange(obj, current_color){ objid = obj.id; objindex = objid.slice(objid.lastIndexOf("_")+1, objid.length); var to_color = "lightblue"; if(current_color == "lightblue") { to_color = "transparent" } for (var i=0; i < cellarray.length; i++) { var cell_name = "GRIDVIEW_" + cellarray + "_" + objindex; document.getElementById(cell_name).style.backgroundColor = to_color; }} Now do it in 2 dimensions. :) JK, I know you know how to do that.... just an outer loop and some variable magic. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now