Deferred chaining , how should I do this?
I am looking to use $.when .pipe .pipe chains to accomplish the following task
Step 0.
- Get id from UI
Step 1.
- Query based on id
$.ajax ({url:myurl, data:{id:id}})
- Should receive a response { "name": "dbtable" }
Step 2.
- Query based on "dbtable"
$.ajax ({url:myurl2, data:{table:Step1response.name}})
- Should receive a response [{"name":"x"},...,{"name":"z"}]
Step 3.
- Work with response from step 2 to setup a data grid model
Q1. Is there a relatively simple syntax to perform these dependent steps?
Q2. How can I use the response of Step 1 in Step 2 if I need to adjust some of the data ?
Thanks,
Richard