Need sample - one-to-many data array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IVer Erling Årva

    #1

    Need sample - one-to-many data array

    Hi!

    I am looking into making a database application and to limit the
    client<->server traffic I want to handle all entry/amendment of the data in
    the browser and save it all once the entry is completed. The problem is that
    I need to include a dynamic table where the user can add, amend and delete
    rows. For the sake of illustrating what I mean I can use the person / pet
    sample where you have one person with several pets, e.g.

    Person name:
    Phone:
    ----------------------------------
    Name: Type: Colour:
    Pet1: [Delete]
    Pet2: [Delete]
    Pet3: [Delete]
    [Add pet]

    I need sample code to show how to handle this array (or a similar situation)
    in terms of adding rows and deleting rows etc. I have tried to look for info
    on this, but cannot find a decent sample anywhere...

    Thanks!
    iver@tda.no


  • steve stevo

    #2
    Re: Need sample - one-to-many data array

    I think you need to be looking at multi dimentional arrays.

    "IVer Erling Årva" <iver@tda.no> wrote in message
    news:3f4b3074$1 @news.broadpark .no...[color=blue]
    > Hi!
    >
    > I am looking into making a database application and to limit the
    > client<->server traffic I want to handle all entry/amendment of the data[/color]
    in[color=blue]
    > the browser and save it all once the entry is completed. The problem is[/color]
    that[color=blue]
    > I need to include a dynamic table where the user can add, amend and delete
    > rows. For the sake of illustrating what I mean I can use the person / pet
    > sample where you have one person with several pets, e.g.
    >
    > Person name:
    > Phone:
    > ----------------------------------
    > Name: Type: Colour:
    > Pet1: [Delete]
    > Pet2: [Delete]
    > Pet3: [Delete]
    > [Add pet]
    >
    > I need sample code to show how to handle this array (or a similar[/color]
    situation)[color=blue]
    > in terms of adding rows and deleting rows etc. I have tried to look for[/color]
    info[color=blue]
    > on this, but cannot find a decent sample anywhere...
    >
    > Thanks!
    > iver@tda.no
    >
    >[/color]


    Comment

    • Douglas Crockford

      #3
      Re: Need sample - one-to-many data array

      > Yes, I thought that might be it. I had however hoped that someone had a[color=blue]
      > ready made full fledged example with all the bells and whistles. It's so
      > much easier when you have some example code to look at. I am trying to get
      > going with a new database lanquage and find the combination of HTML,
      > JavaScript, SQL and the database object script (all of which are new to me)
      > a bit much, especially as I have to do it all by myself. So I thought that
      > rather than reinventing the wheel etc...[/color]

      You probably want an array of objects. JavaScript is particularly nice for those
      sorts of structures. Look at the examples at www.JSON.org. Also Check out


      Comment

      Working...