PAC Display Tables with Database Data


#1

Hello,

These forums have proved an excellent resource for great ideas so I wanted to get some ideas on two problems I am having.

I have data coming in from a MySQL database and all of my MySQL tables have more than four fields (columns) in them. As an example let us say we have the ‘Customer’ table with fields ‘Customer Name’, ‘Address1’, ‘Address2’, ‘City’, ‘State’, etc.

What I need to do is display this kind of data in a PAC Display Table.

The two main problems I am having are:

(1) How can I ‘select’ a row in a PAC Display Table? I want to be able to select a row so that other information gets populated on my screen when I select that row. I know it may not be possible to ‘select’ a row, but what would be the best way around this to be able to do such a thing? I really need some creative ideas.

(2) Since PAC Display Tables can only display four ‘columns’, what is the best way to get around this so that I can display MySQL tables that have more than four fields (columns)? I tried putting PAC Display Tables side by side, but the problem with that is if I scroll one of those PAC Display Tables, none of the other tables next to it will scroll.

Here is a screenshot of my dilemma. As you can see, those three PAC Display Tables can only have four columns (not including the index). Each one of those PAC Display Tables is displaying different fields of my MySQL ‘Customer’ Table. None of the rows are ‘selectable’ either.

Thank you in advance to my questions, I really appreciate it.


#2

Interesting question!

I’ve added a customer request ticket to increase the number of columns in that table tool. How many do you think you’d need? No guarantee this can/will happen, of course, but we may as well ask!

In the meantime, I’ve seen folks do some interesting things with the drop-down tool and Windows with no borders. Here, perhaps you could use a drop-down to select your “index,” and that made a (borderless) window with a table pertaining to that index/Customer come up, which listed the Field Names and their corresponding values.

Kind of turning the display format on its side here, with one PAC Display table/window for each index.

These X windows could be piled on top of each other so the user would have no idea there was more than one window. X would correspond to the number of index values you have (how many customers, in this example). Would that be a lot? Would X change frequently? (Hoping you say no, otherwise this might not be practical.)

Picture:


(here I’m showing PAC Display’s table index slightly hidden, but you could hide it completely).

Assuming all these are string values, the data you’d populate these tables with might be something like:

stFieldNames[0] = “Customer Name”;
stFieldNames[1] = “Address 1”;

(Although I’d use this “Initialize a Giant Table” method if you have more than just a few of these.)

You’d also have a string table for each X (or possibly a pointer table if you have non-string values to use), like this:

stTable01[0] = “Mary”;
stTable01[1] = “123 Main Street”;

stTable02[0] = “Ben”;
stTable02[1] = “22 Opto Lane”;

etc. If you’re with me so far, and don’t mind a pointer here and there, I’d recommend populating these multiple string tables using the GetPointerFromName command, I’d be happy to whip up a little OptoScript example if you’d like…

-OptoMary


#3

Mary,

Thanks for the recommendation and for putting in a ticket on this one. I’d say I would take as many columns in the table tool as they will possibly give me! I’ll be looking into your idea you posted and the pointer tables. This may work, but I need to figure out an educated guess on how many rows will be inserted into my largest MySQL table (since I have others besides Customer) in order to figure out the practicality of having that many border-less windows open. If we have too many ‘Customers’ for instance, selecting them index-by-index won’t be a very good operation for end user.

I’m looking forward on your response to what can be done to the table tool! Thanks again.