The data structure you want for 'config' is an array of objects:

{
    listName: "Bid Key",
    config: [
        {
            staticName: "ModuleNotes",
            value: "Some Comments"
        },
        {
            staticName: "ID",
            value: 14,
            LookupId: true
        }
    ]
 }

When you have an array of objects like this, each object in that array can
have properties that are different from the other objects. There's no
restriction at all on what the individual elements of an array can be - if
the array contains objects, they don't have to have the same "signature". In
fact, a single array can contain elements of any type you want, object or
anything else:

var array = [
    true,
    null,
    { a:'b' },
    { c:'d', e:'f' },
    [ 'x', 'y' ],
    123,
    'abc'
];

-Mike

On Sat, Jun 25, 2011 at 9:26 PM, Matthew Bramer <[email protected]> wrote:

> I think that subject title is syntactically correct.  Feel free to correct
> me if I'm mistaken.
>
> Here's some sample code:
>
> *console.log( somePlugin.Query({ *
> *listName: "Bid Key", *
> *config: {*
> * 1: {*
> * staticName: "ModuleNotes",*
> * value: "Some Comments"*
> * },*
> * 2: {*
> * staticName: "ID",*
> * value: 14,*
> * LookupId: true*
> * }*
> * }*
> *   } *
> * }) *
> *);*
>
> What I'm trying to do is figure out how many things are stuffed inside of
> config.  In this example it would be 2, but there could be 20.  Based on the
> number of things stuffed into config, I need to run different code.  I
> foolishly tried inside the plugin: *opt.config.length* but that returns *
> undefined*.
>
> Does anyone know how to do this?
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to