ZBLOG

function ExternalCommissionConfirmation(init) { var self = new Window(init).setWidth('50vw').setDestroyOnHide(true); self.type = 'ExternalCommissionConfirmation'; self.attr("id", self.type + "" + ggNamespace.getCounter()); // ...

要实现联动效果,当输入customerId后,通过Ajax请求获取loanCode的数据并显示在页面上,你可以按照以下步骤进行:

  1. ExternalCommissionConfirmation函数中添加一个事件处理程序,用于监控customerId字段的值变化。
self.customerId.addChangedHandler(function() {
  var customerId = self.customerId.getValue();
  
  // 发送Ajax请求获取loanCode数据
  isc.RPCManager.sendRequest({
    actionURL: "your_api_url", // 替换为实际的API URL
    httpMethod: "POST", // 或者使用GET,根据需要调整
    contentType: "application/json",
    params: { customerId: customerId },
    callback: function(response, data) {
      if (response.status === 0) {
        var loanCodes = data.loanCodes; // 根据API返回数据格式调整
        self.loanCode.setValueMap(loanCodes); // 设置loanCode选项值
      }
    }
  });
});
  1. 替换代码中的”your_api_url”为实际的API URL,并根据你的API返回数据格式来更新回调函数中获取和设置loanCode的逻辑。

这样,在输入customerId后,会自动触发Ajax请求并将获取到的loanCode数据显示在相应字段中。请确保你已经导入isc库以及正确配置了Ajax相关设置。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=15554

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?