validation - Emberjs Autocomplete updates another one -
i have 2 autocomplete fields , need update second autocomplete list first selection. have.
using jquery.mixin , validation.mixin input boxes.
ng.createinsertblncontroller = ember.objectcontroller.extend(ng.validate,{ content: [] } ng.createinsertblnview = ember.view.extend({ vesselpicker: jq.autocomplete.extend({ source: ng.vessels.autocomplete, minlength: 0 }), voyagepicker: jq.autocomplete.extend({ // jq.autocomplete extends ember.textfield source: ng.voyage.autocomplete, minlength: 0 }) }); ng.vessels = ember.objectcontroller.create({ inputtext: "", autocomplete: function(request, response) { var term = request.term; var self=this; $.getjson( "http://myjsonlink", request, function( data, status, xhr ) { var list = []; $.each(data,function(id,item){ list.push(item.code); }); response( list ); }); } }); ng.voyages = ember.objectcontroller.create({ inputtext: "", autocomplete: function(request, response) { var term = request.term; var self=this; $.getjson( "http://myjsonlink", request, function( data, status, xhr ) { var list = []; $.each(data,function(id,item){ list.push(item.code); }); response( list ); }); } });
i tried creating ng.vessels , ng.voyages in controller, in view i'm not able retrieve controller data. question how can declare 2 objects in controller, how invoke them view , how refresh second autocomplete. appreciated thanks.
Comments
Post a Comment