Well, WDDX gives you some well defined and documented ways of handling  
a recordset with _javascript_, on the client -- and approximates the way  
you handle a recordset with CF.

In fact, if you look at the code that cfwddx generates it is similar to  
yours:

// Use WDDX to move from CFML data to _javascript_
qj = new WddxRecordset();
col0 = new Array();
col0[0] = 1;
col0[1] = 2;
*
*
*
col0[13] = 14;
col0[14] = 15;
qj["emp_id"] = col0;
col0 = null;
col1 = new Array();
col1[0] = "Peterson";
col1[1] = "Heartsdale";
*
*
*
col1[13] = "Reardon";
col1[14] = "Barnes";

The extra array gives an approximation of the record set.

But, setting each array entry, individually (your example or wddx) is  
verbose  (256% overhead, observed in bandwidth & RAM) and inefficient  
(parse/serialize/deserialize)

You could do it all with 13% overhead and 1 js command and 1 array:

myList = "1|2|...|13|14|Peterson|Heartsdale|...|Reardon|Barnes|...|";

myArray= myList.split('|');

I generalized this a little into a concept I call thinArray.

which looks like this (you should display this in a fixed-width font,  
and no wrap):


|  6 | Emp_ID | LastName | FirstName | Department | Phone | email | 1  
| Peterson | Carolyn | Sales | (612) 832-7654 | CPETERSON | 2 | Smith |  
......
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to