[jQuery] Re: blockUI... I must be doing something wrong...

2007-08-07 Thread Christopher Jordan
Mike, it does indeed seem that $StoreUpdateForm[0] is undefined on
subsequent clicks. I don't understand why that should be! I've got something
happening now that is causing my page to be repetitively blocked and
unblocked such that it looks like the screen is flashing with a slow fade
(if I weren't having a problem, I'd say it even looks kinda cool ;o).

Mike, if you've got some time. Please email me off list and I can show this
to you in action.

Thanks,
Chris


Notice that this time instead of caching the jQuery object
$(#StoreUpdateForm) into a variable called $StoreUpdateForm, I now force
jQuery to look it up each time I use it.

On 8/6/07, Christopher Jordan [EMAIL PROTECTED] wrote:

 Mike, thanks. I'll check that. email me off list if you'd like to see
 it working... or not working... or whatever ;o)

 On 8/6/07, Mike Alsup [EMAIL PROTECTED] wrote:
 
  Chris,
 
  It's hard to say without seeing the code in action.  Try putting a
  break on the line where $.blockUI is called.  Based on your
  description it would seem like $StoreUpdateForm[0] is null at that
  point.
 
  Mike
 
 
   success: function(data) {
   $StoreUpdateForm.empty().append(data);
   $(#CloseBtnID).bind(click,function(){
   $.unblockUI();
   });
   $(#SaveBtnID).bind(click,function(){
   alert(coming soon);
   });
   $.blockUI($StoreUpdateForm[0],{padding:'2px',
   borderColor:'#3F6F5E', top:'25%', left:'50%' });
 


 --
 http://cjordan.us




-- 
http://cjordan.us


[jQuery] Re: blockUI... I must be doing something wrong...

2007-08-06 Thread Christopher Jordan

this didn't seem to post the first time even though it's in my sent
items. hopefully it will work this time. i really need help with this.
thanks,
chris

On 8/6/07, Christopher Jordan [EMAIL PROTECTED] wrote:
 Hi folks,

 I'm in need of some help. I'm using blockUI to display a small set of fields
 to the user along with two buttons, save and close. This little
 psuedo-form (it's not a true form) appears when the user clicks on a store
 from a list of stores that I'm displaying for them. It works great on the
 first click (regardless of the store selected) but doesn't work for any
 subsequent clicks. All subsequent clicks display the default Please Wait
 message.

 Here's how I'm accomplishing this so far:

 The list of stores is in a table. Each row has a click bound to it that
 calls a function called SetClickEvent. For different tables this function
 performs different actions. In the case of selecting a store, it basically
 binds that click to the function EditStore. The EditStore function then
 makes an ajax call to my ColdFusion server which builds the psuedo-form and
 returns it so that jQuery can then place it in the DOM. The psuedo-form
 comes back from the server with all its buttons and all it's fields
 pre-filled depending on which store was clicked.

 Immediately after putting the markup into the DOM, I use jQuery to find the
 buttons and bind their click events to them. Then I call blockUI to show the
 psuedo-form.

 Like I said, it works like a champ the first time around, but all subsequent
 clicks fail. Here's the EditStore function:

 function EditStore(id){
 alert(id);
 var $StoreUpdateForm = $(#StoreUpdateForm);
 var $MessageArea = $(.SystemMessages);
 $MessageArea.empty().append(Loading...).show();
 $.AjaxCFC({
 url: CFC/Display.cfc,
 method: displayStoreUpdateForm,
 data: {id:id},
 unnamedargs: false,
 serialization: json,
 success: function(data) {
 $StoreUpdateForm.empty().append(data);
 $(#CloseBtnID).bind(click,function(){
 $.unblockUI();
 });
 $(#SaveBtnID).bind(click,function(){
 alert(coming soon);
 });
 $.blockUI($StoreUpdateForm[0],{padding:'2px',
 borderColor:'#3F6F5E', top:'25%', left:'50%' });

 },
 complete: function(){
 $MessageArea.empty().hide();
 }
 });
 }

 Unlike, most of my projects this one can be viewed online, but I'd have to
 give my password to the development area of this little app., and (I know
 this is a bad thing, but...) even in the development version it deals with
 live data. I'm hesitant to just post that information to a list. It's not
 that the app allows access to overly sensitive data, but I'd rather be safe.

 Let me know if you just have to, have to, have to see the bug in the wild.

 I am using the latest version of blockUI, with the latest version of jQuery.
 I have verified (via the alert statement that you can see at the top of the
 EditStore function) that each time a store gets clicked on, it's ID is
 indeed passed into the function as expected. Presumably the problem exists
 somewhere in the success block of my ajax call.

 Cheers,
 Chris

 --
 http://cjordan.us



-- 
http://cjordan.us


[jQuery] Re: blockUI... I must be doing something wrong...

2007-08-06 Thread Mike Alsup

Chris,

It's hard to say without seeing the code in action.  Try putting a
break on the line where $.blockUI is called.  Based on your
description it would seem like $StoreUpdateForm[0] is null at that
point.

Mike


 success: function(data) {
 $StoreUpdateForm.empty().append(data);
 $(#CloseBtnID).bind(click,function(){
 $.unblockUI();
 });
 $(#SaveBtnID).bind(click,function(){
 alert(coming soon);
 });
 $.blockUI($StoreUpdateForm[0],{padding:'2px',
 borderColor:'#3F6F5E', top:'25%', left:'50%' });


[jQuery] Re: blockUI... I must be doing something wrong...

2007-08-06 Thread Christopher Jordan

Mike, thanks. I'll check that. email me off list if you'd like to see
it working... or not working... or whatever ;o)

On 8/6/07, Mike Alsup [EMAIL PROTECTED] wrote:

 Chris,

 It's hard to say without seeing the code in action.  Try putting a
 break on the line where $.blockUI is called.  Based on your
 description it would seem like $StoreUpdateForm[0] is null at that
 point.

 Mike


  success: function(data) {
  $StoreUpdateForm.empty().append(data);
  $(#CloseBtnID).bind(click,function(){
  $.unblockUI();
  });
  $(#SaveBtnID).bind(click,function(){
  alert(coming soon);
  });
  $.blockUI($StoreUpdateForm[0],{padding:'2px',
  borderColor:'#3F6F5E', top:'25%', left:'50%' });



-- 
http://cjordan.us