User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » How would you approach this Page [1]  
Raige
All American
4386 Posts
user info
edit post

I've been asked to create a 100 by 100 grid, where each block can be clicked on and the color changed. Once they have what they want, you click save and it saves the pattern.

Most of the ways I've thought to approach this have been "ugly" and not very efficient. This is also a bit difficult for a database design because of column limitations.

I've thought about combining values in single columns and trimming it out but that seems very inefficient and long to load. This must be a web interface.

As I said I know the ugly way to do this but hoping for a more reasonable solution/design.

5/31/2006 9:10:28 AM

Kris
All American
36908 Posts
user info
edit post

java applet

use a two dimensional boolean array

boolean[][] clickArray = new boolean[100][100];

[Edited on May 31, 2006 at 9:21 AM. Reason : ]

5/31/2006 9:20:14 AM

qntmfred
retired
40726 Posts
user info
edit post

columns could be x_pos, y_pos, color. print out 100x100 divs and have an onclick event that calls a javascript color chooser which sets the color of that div. when you submit, loop through the divs to get the positions and colors and do your queries.

5/31/2006 9:21:02 AM

Maugan
All American
18178 Posts
user info
edit post

uhh

you can't have a 100 column table?

what kind of POS database are you using?

5/31/2006 11:18:25 AM

Kris
All American
36908 Posts
user info
edit post

this isn't as much an application for a practical database

it's more just an array that stores 100 individual color states arranged in a grid, then I'd just write all that stuff to a file or cookie using bools or ints, depending on how many color states you want

it's really basic java, easy stuff

5/31/2006 11:21:38 AM

Raige
All American
4386 Posts
user info
edit post

yeah I've been told Java but I know --> <-- that much java. That looks to be the best option though, so guess it's time to learn Java!

5/31/2006 2:47:49 PM

Shadowrunner
All American
18332 Posts
user info
edit post

i second kris's idea... simple java applet with a two-dimensional array and an onclick function that passes the cell clicked and returns the color it should be redrawn to.

5/31/2006 4:33:17 PM

Raige
All American
4386 Posts
user info
edit post

As for what database this is a tool that needs to be portable from ACCESS/MSSQL/MySQL. Access has a limitation on columns.

Learning Java now. ug...

[Edited on June 6, 2006 at 11:00 AM. Reason : !]

6/6/2006 11:00:23 AM

Pyro
Suspended
4836 Posts
user info
edit post

what's wrong with php and a big html table(or divs, whatever)

[Edited on June 6, 2006 at 11:16 AM. Reason : can most people even run java applets anymore?]

6/6/2006 11:15:48 AM

Kris
All American
36908 Posts
user info
edit post

you don't have to use a java applet, you can just use javascript

Additionally, if you are using Access for any real database application you should stop RIGHT NOW. It's extremely unstable if you've got anything more than a handful of users. Instability due to concurrency is not acceptable in a business enviroment, as there might be a chance someone could rip off your company by just making multiple accesses to the database.

If you are using access, stop learning java, and start making an Oracle DB, then when you finish get back to learning java, it's the same as C/C++, so if you know that it should be easy.

6/6/2006 12:24:34 PM

qntmfred
retired
40726 Posts
user info
edit post

like ^^ said, java pretty much sucks for web interfaces. especially something straightforward like this. java takes forever to load and you're lucky if it doesn't crash your browser. in my experience, anyways.

seriously, i would just do a combination of php/css/javascript/mysql to do this. shouldn't be more than 50 lines.

6/6/2006 12:28:39 PM

Kris
All American
36908 Posts
user info
edit post

I didn't know it was a web interface, doesn't really say that, which is why I suggested java

6/6/2006 12:41:21 PM

BobbyDigital
Thots and Prayers
41777 Posts
user info
edit post

in the original post:

Quote :
"This must be a web interface. "

6/6/2006 1:10:44 PM

Kris
All American
36908 Posts
user info
edit post

doesn't say it in the first sentence

which is all I read

6/6/2006 1:24:22 PM

Stein
All American
19842 Posts
user info
edit post

JavaScript and a table is the easiest way to do it.

It really isn't hard to implement at all, unless you want to get really fancy with it.

6/6/2006 3:10:51 PM

Pyro
Suspended
4836 Posts
user info
edit post

Yea, I was trying to figure out what I'd missed, the way you fools were going on about java.

6/6/2006 4:31:28 PM

Kris
All American
36908 Posts
user info
edit post

you could do it with flash and actionscript as well, but javascript is much easier

6/6/2006 5:49:19 PM

bous
All American
11215 Posts
user info
edit post

you could do it in vb with a web exe!

6/6/2006 6:21:58 PM

Kris
All American
36908 Posts
user info
edit post

6/6/2006 6:34:36 PM

 Message Boards » Tech Talk » How would you approach this Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.