如何在QuickBase中使用jQuery填充多维数组
How To Populate Multidimensional Array with jQuery in QuickBase
我在一个测试html页面中有代码,它运行良好。它构建了一个NxN多维数组,在构建页面时将字段分组到QuickBase表单中。以下是填充window.flds数组的代码:
<script type="text/javascript">
var flds = [];
function pushFields(groupIdx,srcVal){
var iGroupIdx = groupIdx+1;
if(iGroupIdx > window.flds.length){
var fldsfloor = window.flds.length;
for(var i = fldsfloor; i < iGroupIdx; i++){
if(!window.flds[i]){
window.flds[i] = [];
}
}
}
var j = window.flds[groupIdx].length;
window.flds[groupIdx][ j ] = srcVal;
}
//dummy code to populate window.flds manually:
pushFields(17,101);
pushFields(17,104);
pushFields(5,102);
pushFields(28,103);
pushFields(28,105);
</script>
当我尝试将它硬塞进QuickBase模板时,它不起作用。QuickBase使用jQuery构建字段。如何从jQuery:调用JavaScript函数pushFields(x,y)
function loadProcess(root, rid) {
//... code doesn't get relevant until here:
if(groupx == 5){
var processRes = getResults("abcde1fgh", "{3.EX." + rid + "}", "3.102", "60");//the value of 3 would be 5 for the first parameter, and 102 would be the second parameter.
var ctrl1 = "<br /> Date" + addControl(v[3], "Date", "", v[102], "", " ");
}
//... code doesn't get relevant again until here:
if(groupx == 17){
var processRes = getResults("abcde1fgh", "{3.EX." + rid + "}", "3.101.104", "60");//the value of 3 would be 17 for the first parameter, and 101 and 104 would be the second parameter.
var ctrl2 = "<br /> FName" + addControl(v[3], "Text", "", v[101], "", " ");
var ctrl3 = "<br /> LName" + addControl(v[3], "Text", "", v[104], "", " ");
}
//... code doesn't get relevant again until here:
if(group3 == 28){
var processRes = getResults("abcde1fgh", "{3.EX." + rid + "}", "3.103.105", "60");//the value of 3 would be 28 for the first parameter, and 103 and 105 would be the second parameter.
var ctrl4 = "<br /> Email" + addControl(v[3], "Text", "", v[103], "", " ");
var ctrl5 = "<br /> Phone" + addControl(v[3], "Text", "", v[105], "", " ");
}
}
谢谢大家,我找到了一个解决方案:
pushFields(102,v[3]);
相关文章:
- 用我的json数据填充JQuery DataTable
- 解析和填充 jQuery 插件的选项数组
- 试图用php文件填充jquery
- 用 angularjs 填充 jquery 移动表
- 从替代字段填充 jquery UI 日期选择器日期字段
- 使用 ajax 从 mysql 填充 jQuery 数据表
- 尝试从 JSON 文件填充 JQuery 中的列表.如何调试
- 用服务器数组填充 jquery 数组
- 如何使用 Restangular 填充 jQuery UI Select2
- 如何从 Ajax 响应中重新填充 jquery UI 日期选择器
- 从 XML 填充 jquery 表单
- 使用每个选择的值填充 jquery 数组
- 如何从 pouchdb 数据填充 jquery 移动列表视图
- 用数据预填充 jQuery 自动完成
- 用如何刷新列表填充 jquery 页面
- 用javascript变量填充jquery模态表单字段值
- 重新填充Jquery多选框
- 用多个列表填充jquery select下拉表单
- 动态填充jquery UI类别自动完成
- 从数组中随机选择一个项目并填充-jQuery