-
14 Dec 2006 8:05 AM #1
Javascript function in updateManager returned content
Javascript function in updateManager returned content
Hi Guys,
Hope everyone is cool. I have had an extensive look around the forums and cannot find an answer to my problem, any suggestions would be appreciated.
The problem: I would like to use the wonderful qforms library http://www.pengoworks.com/index.cfm?action=get:qforms on forms thoughout my site, but I am having trouble getting the javascript to execute. The forms are stored server side and only called into the content panels when needed using the update manager. I see there is a loadScripts property and this works great to run any scripts in the fetched content, but I cannot get access to functions in the returned data after the update is complete. The browser (IE or FF) always reports <function> is not defined. Is this because the returned scripts are not actually added to the DOM.
The real issue is that qform automatically binds to the form onload, hahaha, but baby steps, baby steps.
PS the pagin on the form search seems to fail 8(
Thanks in advance.
David.
-
14 Dec 2006 8:31 AM #2
Because the function scripts are eval'ed, they are going to be scoped to where they are eval'ed. This means they won't be visible globally. I don't know of any workaround.
Can you modify the functions returned to assign to a globally available object? For example, instead of:
function test(){...}
use
YAHOO.thinka.test = function(){...}
I know this sucks, but then it would be available everywhere.
-
14 Dec 2006 9:06 AM #3
Hi Jack,
That's ok. I will use an iframe in a dialogue instead. That should work for now.
Thanks again for the help and the wonderful toolset.
-
14 Dec 2006 2:34 PM #4
Originally Posted by jacksloc
should do it. We do this in AjaxAnywhere.Code:window[objName] = eval(objName);
Sanjiv
-
14 Dec 2006 2:50 PM #5
I'm not a big fan of attaching JS Objects to DOM Objects. IE is not real happy about it.

Similar Threads
-
UpdateManager.update() duplicates header content
By thejoker101 in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 29 Mar 2007, 12:39 PM -
updateManager and callback function
By martin in forum Ext 1.x: Help & DiscussionReplies: 5Last Post: 10 Jan 2007, 7:01 PM -
Javascript basics - variable from nested function?
By angusf in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 17 Dec 2006, 3:35 PM -
YAHOO.ext.UpdateManager setting Content-Type for ISO-8859
By young_matthewd in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 14 Nov 2006, 11:32 AM -
tabpanel content and javascript
By jbowman in forum Ext 1.x: Help & DiscussionReplies: 8Last Post: 12 Sep 2006, 7:43 PM


Reply With Quote