Adding childs to list of parents with jquery /mvc2
- by John Landheer
Hi,
I have a table of products on my page, each product has zero or more colors, the colors are shown as a list beneath the product. After the colors I have a button to add a color. The button will do an ajax call with the parent product id to a controller which will return a JSON object with color information. My problem is where to store the product id in the DOM, should I put it in a hidden field and use jquery in the click event of the "add color" to get to it? What is the best way to do this?
TIA,
John
EDIT: The page is initially rendered on the server so I don't want to use jquery to add the id's to the page.