javascript - how and where to insert a callback function -


In my web app, in some form, I have a button that can click to find the username Corporate Directory Once they get the name, they click on the results and the population is populated on the name and other directory data form. At least, I would like to do it.

My question is how to use the callback function properly so that my data lookup can be brought back, where I can parse it

for the correct fields From the page I have the following functions:

  $ ("LookupNameBTN"). Button ({icon: {primary: "ui-icon-gear"} "). Button (click on function (event) {var btn = $ (this) .attr (" data "); mainApp.lookup (function (Obb) {if (btn == "request" $ {"input [name = requested name]"). Val (obj.cil);}; // if request (BTN == "customer") {$ ("Input [Name = clientName] "). Val (Obj.cil);}; // client}); // lookup}); // click  

mainApp.lookup () dialog Opens the box and loads the server files.

  mainApp.lookup = function (callback) {if ($ ("$ LookupDialog"). Length == 0) {$ ("body "). Enclosed (" 
  $ ("#lookupResultsTbltr") ("Click", function () {var rslt = $ (this) .attr ("data"); // magic is considered to return here}); // click  

After the value has been reached, how do I clarify how to get it back in the callback function?

I really appreciate the help.

Thanks, Gary

UPDATE: I've added the coldfusion tag using CF 9 for my server side. Since this is not specific to server side, I will remove that tag.

My question is about continuation of a form page, I'm calling mainApp.lookup. I would like to provide a callback in that function which gives data from the directory lookup.

The load function is completed and returns the html for the dialog box. The user should find a name with that dialog and return the results.

I am looking for a way to return data in the TR click event in the main app.lookup box in dialog and then to callback in original form in my form.

You should be able to call it safely if (S == "success" ) your callback function in the code block;

  mainApp.lookup = function (callback) {if ($ ("(# $ lookupDialog)"). Length == 0) {$ ("body"). Attached ("& lt; div id = \" lookupDialog \ "class = \" dialogDivs \ "/>;); }; (Div == "success") {callback ()) / div ("# lookupDialog"). (Main Title: "Corporate Directory", Model: True, Width: 600, Height: 450, Status: {my: "Main": " Close the "center" center, at: "center" ("deleted") dialog. ();} // close}); // dialog} else {alert}: "#app"}, close: function () {$ ("# LookupDialog"). ("Error loading");} // success}); // load}; //mainApp.lookup  

.. whatever standard jQuery .load () is also in the callback function. So I hope I have understood your question properly!


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -