Page tree
    Created with Raphaël 2.1.0
    Loading...
转至元数据结尾
转至元数据起始

正在查看旧版本。 查看 当前版本.

与当前比较 查看页面历史

« 前一个 版本 8 下一个 »

范例:

以常见的省市县三级联动举例,如下代码配置在在省下拉框的onChange事件中的JsAction中

let currentValue = payload.changedValue; //获取当前下拉框的值
if ( !currentValue) {
  return;
}
 
let body = {};  //定义请求restAPI的body
let parentKeys = [];
body.entityName = "com.open_care.sys.OcAddress";
body.fieldName = "city";
body.relationFieldName = "parentKey";
parentKeys.push(currentValue);
body.parentKeys = parentKeys;
 
function getResponseHandler(response) {
    let targetComponent = ocWindow.getComponentByName('Form1_city');  //根据componentName=Form1_city找到市组件
  let value = response.data;  //获得返回的数据
  targetComponent.setOptions(value); //将返回的结果放入市下拉框中
  targetComponent.setValueOfFirstOption(); //默认显示下拉框的第一个值
 
  return;
}
 
OC.restPostApiCall('/getValueOptions', {}, body, getResponseHandler) //调用后端RestAPI,getResponseHandler为回调函数

表格中某一列变为超链接,在Table的onCreate事件中配置JS Action

ocWindow.getComponentByName('Table1').addColumnForHyperLink('vendor_code'); // vendor_code 指Column的DataIndex

错误的渲染宏 'viewdoc' : The viewfile macro is unable to locate the attachment "JS SDK使用说明1.0.docx" on this page

  • 无标签