The data name of the foreign key is displayed in a list for the apprentice today. However, the foreign key is composed of multiple data names. Therefore, the data is saved to and 2222, which are separated by commas.
However, the information of 111, 222, and needs to be displayed, so I will come to a for and go to ext in the background. ajax requests, 111, and 222 records need to be spliced at last, but I am using
Ext.Ajax.request ({ url: 'foo.php', success: someFn, failure: otherFn, headers: { 'my-header': 'foo' }, params: { foo: 'bar' }})
In this way, I want to process some data in the callback function of success, and then assign it to Ext. ajax. when a variable outside the request function is declared, it cannot be assigned a value. Use this. XXX is not acceptable.
So Id do
var sellContractNumStr=""; var sellContractNumArray = c.split(','); for (var i = 0; i < sellContractNumArray.length; i++) { var conn = Ext.lib.Ajax.getConnectionObject().conn; conn.open("post", __ctxPath +'/erp/getQyPure.action?qyPureId='+sellContractNumArray[i],false); conn.send(null); if (conn.status == "200") { var qyPure = Ext.util.JSON.decode(conn.responseText).data; sellContractNumStr+='<span><a href="#" onclick="QyPureDetail.show(' + qyPure.qyPureId + ')">' + qyPure.pureContact + '</a> | </span>'; } }
This request method looks a little earthy. Haha
var conn = Ext.lib.Ajax.getConnectionObject().conn; conn.open("post", __ctxPath +'/erp/getQyPure.action?qyPureId='+sellContractNumArray[i],false); conn.send(null); if (conn.status == "200") { var qyPure = Ext.util.JSON.decode(conn.responseText).data; sellContractNumStr+='<span><a href="#" onclick="QyPureDetail.show(' + qyPure.qyPureId + ')">' + qyPure.pureContact + '</a> | </span>'; }
Continue learning.