When valueField/textField are not explicitly set in opts, the auto-select logic (line 1140) and nullable empty-option creation (lines 1144-1145) used data[0][undefined] which returned undefined, causing: - Single-option selects to show blank (auto-select failed) - nullable empty options to have undefined keys Now extracts vf/tf local variables with ||'value'/||'text' fallback at the top of build_options(), used consistently throughout.
1.1 KiB
1.1 KiB
editabletree
用法
<html>
<head>
<link rel="stylesheet" href="/bricks/css/bricks.css">
</head>
<body>
<script src="/bricks/bricks.js"></script>
<script>
const opts =
{
"widget": {
"widgettype":"urlwidget",
"options":{
"url":"editabletree.json"
}
}
}
;
const app = new BricksApp(opts);
app.run();
</script>
</body>
</html>
效果图
widget参数说明
| 参数 | 参数说明 | 类型 | 是否必填 | 可选值 | 默认值 |
|---|---|---|---|---|---|
| widgettype | 控件类型 | String | 是 | urlwidget | --- |
| options | 控件配置项 | Object | 是 | --- | --- |
options参数说明
| 参数 | 参数说明 | 类型 | 是否必填 | 可选值 | 默认值 |
|---|---|---|---|---|---|
| url | 数据来源 | String | 是 | --- | --- |
注意:url可以是个json文件
