Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 余烬js中更改侦听器的组合框_Javascript_Asp.net Mvc_Ember.js_Handlebars.js - Fatal编程技术网

Javascript 余烬js中更改侦听器的组合框

Javascript 余烬js中更改侦听器的组合框,javascript,asp.net-mvc,ember.js,handlebars.js,Javascript,Asp.net Mvc,Ember.js,Handlebars.js,我使用下面的代码在余烬中显示组合框 {{view "select" content=model prompt="Please select a name" selectionBinding="App.selectedComboBoxController.model" optionValuePath="content.fullName" optionLabelPath="content.title" }} 输出 我的要求是组合框更改时间如何调用下面的提交功能 App.Comb

我使用下面的代码在余烬中显示组合框

{{view  "select"  content=model    prompt="Please select a name"  selectionBinding="App.selectedComboBoxController.model"  optionValuePath="content.fullName" optionLabelPath="content.title"   }}
输出

我的要求是组合框更改时间如何调用下面的提交功能

App.ComboBoxRoute = Ember.Route.extend({

    model: function () {     
          return posts;     
    },
    actions: {
        submit: function () {
           textId = document.getElementById("emnn");
           textId = textId.value;
            alert(textId);
        }
    }

});

您可以向组合框值添加观察者。在“观察者”中,发送一个动作,该动作将使路线冒泡

App.SelectedComboBoxController = Em.ObjectController.extend({
  model:null,

  selectionChanged: function() {
    this.send('submit', this.get('model'));
  }.observes('model')
});

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return [
      {fullName:"the full name1", title:"the title1"},
      {fullName:"the full name2", title:"the title2"},
      {fullName:"the full name3", title:"the title3"}
    ];
  },
  actions: {
    submit: function (item) {
      alert(item.fullName);
    }
  }
});