具有 multiple:true 的羊驼框架 select 继承了其前兄弟姐妹的 selection 状态
Alpaca framework select with multiple:true inherits the selection status of its former siblings
这个问题最初在 alpaca 框架 github 上提出,https://github.com/gitana/alpaca/issues/731
只需在此处打开一个以获得 Whosebug 社区的支持。
A Combination of multi select and array cause a problem that the second and later select boxes inherit the selection status of their former siblings.
See my codepen: https://codepen.io/hadakadenkyu/full/pooKyzy
任何帮助将不胜感激!!
您的问题与您创建的对象 datasource
有关。
在内部 alpajajs 将您的 datasource
对象转换为文本和值,并且它只需要 {key: value}
类型,因此在您的示例中您应该执行 {"2001": 2002}
例如。
此外,在您的 alpaca 表单数据对象中,您应该使用 select 选项值而不是像这样的文本:year: ["2001", "2003"]
更新:
我重新检查了文档,我看到了:
Datasource for generating list of options. This can be a string or a function. If a string, it is considered S be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.
因此,为了使您的示例有效,您应该将 datasource
对象值包装到一个函数中,例如:
dataSource: function(callback) {
callback([
{ "text": "2000", "value": 2000 }, ...
这是第一个example。
这是第二个 example。
这个问题最初在 alpaca 框架 github 上提出,https://github.com/gitana/alpaca/issues/731
只需在此处打开一个以获得 Whosebug 社区的支持。
A Combination of multi select and array cause a problem that the second and later select boxes inherit the selection status of their former siblings.
See my codepen: https://codepen.io/hadakadenkyu/full/pooKyzy
任何帮助将不胜感激!!
您的问题与您创建的对象 datasource
有关。
在内部 alpajajs 将您的 datasource
对象转换为文本和值,并且它只需要 {key: value}
类型,因此在您的示例中您应该执行 {"2001": 2002}
例如。
此外,在您的 alpaca 表单数据对象中,您应该使用 select 选项值而不是像这样的文本:year: ["2001", "2003"]
更新: 我重新检查了文档,我看到了:
Datasource for generating list of options. This can be a string or a function. If a string, it is considered S be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.
因此,为了使您的示例有效,您应该将 datasource
对象值包装到一个函数中,例如:
dataSource: function(callback) {
callback([
{ "text": "2000", "value": 2000 }, ...
这是第一个example。
这是第二个 example。