[jQuery] Re: Selector Logic

2008-12-30 Thread daveyoi

Thanks both for your excellent suggestions.. and thanks for the links
on Context Joe. :)


[jQuery] Selector Logic

2008-12-29 Thread daveyoi

Hey guys,

Sorry for a real basic question but I just cant work this out..  I
have the following structure based on a jqGrid output..

div id=div_1
div
table
tbody
tr
td class='headerLeft'IMG //tdthTEXT/th
td class='headerButton'IMG //td
td class='headerRight'IMG //td
/tr
/tbody
/table
/div
/div

based on that structure how do access the IMG that belongs to the td
with class headerButton?

Been scratching my head for 2 hours now :(






[jQuery] Re: Selector Logic

2008-12-29 Thread daveyoi

Sorry - left out the important part

The containing div (div_1)  can be created more than one on a page --
so div_1 , div_2 , div_3  and they would all contain the structure
described above.. this is why I cant just access using $
(.headerButton) as there could be potentially more than 1.

I reasoned therefore that i need  to access via the unique div_n id
and make way through the selectors to ensure i get the right one..?



[jQuery] Design question

2008-11-24 Thread daveyoi

Hello Everyone,

I am new to jquery and am using it in a project to develop a PHP based
Mysql report generator. My question is not 100% jquery but more on
application design?

I have a bunch of list items that I can drag and drop (thanks to
jquery) on to a workspace - on dropping I create a TH/TH elelment
with the value of the list item and an image which has a .click()
attached with a call back to a remove(). - This all works as expected
and really demonstrates how after just a couple of hours how powerfull
jquery is.

The hard part that I just cant get my head round is I need the value
and position of each item dropped onto the page stored somehow. I have
been using a bog standard js array and just pushing the new value into
the array on the drop callback but if I remove one of the TH/TH
then my array keys become out of sync.

Any suggestions on how best to approach this - I am primarily a PHP
developer and have been thinking of using Ajax to store the data in a
temp table but this seems a little longwinded.. js gurus your ideas?

Thanks - and hope I can repay the favour some time.

Dave