[jQuery] Re: jquery ui dialog get element from button

2009-07-24 Thread Mean Mike
ok sorry for the delay, been kind of busy. Your problem is this ... the var somevar is defined in the click function and your are trying to use it in the constructor for the dialog therefore it is out of scope and not defined. This wouldn't work even if you made the var global because you must

[jQuery] Re: jquery ui dialog get element from button

2009-07-24 Thread Carlo Landmeter
Hi Mike, Yes its working now. Now that i understand that part and looked at the api again i saw: Get or set the buttons option, after init. Glad I get that fixed. Thanks for your help! I think if i play more with jquery things get easier for me to understand. Carlo On Fri, Jul 24, 2009 at

[jQuery] Re: jquery ui dialog get element from button

2009-07-22 Thread Carlo Landmeter
Sorry i forgot to add it. img style=cursor:pointer class=button id=REF09624002 src=images/delete.png / The button is placed before the dialog div. Carlo On Tue, Jul 21, 2009 at 2:43 PM, Mean Mikemcgra...@gmail.com wrote: Carlo buddy where is the button with the id that your looking for ?

[jQuery] Re: jquery ui dialog get element from button

2009-07-21 Thread Carlo Landmeter
I'm not able to send the whole html but i can show you the jquery stuff: I am using this in a drupal CMS with jQuery 1.2.6 and jQuery UI 1.6. Drupal includes the following css/js style type=text/css media=all@import /sites/default/modules/jquery_ui/jquery.ui/themes/default/ui.all.css;/style

[jQuery] Re: jquery ui dialog get element from button

2009-07-21 Thread Mean Mike
Carlo buddy where is the button with the id that your looking for ? On Jul 21, 5:06 am, Carlo Landmeter clandme...@gmail.com wrote: I'm not able to send the whole html but i can show you the jquery stuff: I am using this in a drupal CMS with jQuery 1.2.6 and jQuery UI 1.6. Drupal includes

[jQuery] Re: jquery ui dialog get element from button

2009-07-20 Thread Mean Mike
can I see the html that goes with this code ? On Jul 18, 4:48 am, Carlo Landmeter clandme...@gmail.com wrote: Thanks for tip for my vars. I have tried the code you provided but this does not work. When i click my delete button it will complain that somevar is not set. So i guess it means the

[jQuery] Re: jquery ui dialog get element from button

2009-07-18 Thread Carlo Landmeter
Thanks for tip for my vars. I have tried the code you provided but this does not work. When i click my delete button it will complain that somevar is not set. So i guess it means the dialog function is run before the somevar variable is set. Anyway arround this? carlo On Fri, Jul 17, 2009 at

[jQuery] Re: jquery ui dialog get element from button

2009-07-17 Thread Carlo Landmeter
I will try that ones I have tackled the following issue. I keep having issues with dialog because the dialog is created before i use the .click function. Because of this i cannot change some options of the dialog. For instance: If i click the button i am able to retrieve the id of this button

[jQuery] Re: jquery ui dialog get element from button

2009-07-17 Thread Mean Mike
Carlo, jQuery /javascript is procedural so you just need to move things around like this [code] $(document).ready(function(){ $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5},

[jQuery] Re: jquery ui dialog get element from button

2009-07-16 Thread Mean Mike
Yes that is correct you need to separate the dialog from the open like this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $('#dialog').dialog('open');

[jQuery] Re: jquery ui dialog get element from button

2009-07-16 Thread Charlie
dialog has a setter option for title, it isn't really a title attiribute. The dialog "title is actually a span with class ui-dialog-title-dialog http://jqueryui.com/demos/dialog/#option-title $('.selector').dialog('option', 'title', 'Dialog Title'); either pass the id into the option or you

[jQuery] Re: jquery ui dialog get element from button

2009-07-16 Thread Mean Mike
I didn't realize there was a setter option for that, cool now I can change my code LOL Mean Mike On Jul 16, 9:55 am, Charlie charlie...@gmail.com wrote: dialog has a setter option for title, it isn't really a title attiribute. The dialog title is actually a span with class

[jQuery] Re: jquery ui dialog get element from button

2009-07-16 Thread Carlo Landmeter
Thanks for your replies. If I look at your first option I wouldn't know how i could know the correct ID before i click the button but i have to initiate the dialog open after the normal dialog function. You second option seems the best way for me, after the dialog is created i can modify its

[jQuery] Re: jquery ui dialog get element from button

2009-07-16 Thread Charlie
sure, just add $("#dialog").load("url") to click function you have Carlo Landmeter wrote: Thanks for your replies. If I look at your first option I wouldn't know how i could know the correct ID before i click the button but i have to initiate the dialog open after the normal dialog