TypeError:无法在'Node'上执行'appendChild':参数1不是'Node'类型的。 Arcgis 4.13

问题描述 投票:0回答:1

我正在使用arcgis 4.13,并具有以下选择:

<select id="selectYear" name="selectYear" dojoType="ComboBox" style="width:200px;font-size:16px;" >
</select>

我正在尝试处理更改事件:

var select = dom.byId("selectYear");
on(select, "change", function(e) {

..

但是,我在此行出现以下错误:

on(select, "change", function(e) {

错误是:

MapView.js:351 Uncaught (in promise) TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

不确定是什么问题。任何帮助,将不胜感激。谢谢。

arcgis-js-api
1个回答
0
投票

我认为您在模板上以及在检索组合小部件的代码上可能有问题。

尝试将模板更改为,

<select id="selectYear" name="selectYear" data-dojo-type="dijit/form/ComboBox"
  style="width:200px;font-size:16px;" >
</select>

并且要使用这样的dijit\registry来检索组合小部件,

registry.byId("selectYear").on("change", function() {
  ...
});
© www.soinside.com 2019 - 2024. All rights reserved.