J
jts-law
Guest
Shelley/Community, I've decided to reinvent the wheel with this issue. Based on an Angular example I found,I created a custom HTML component and added 2 select tags with 2 buttons (left and right). The issues I'm now having is figuring out how to integrate straight Angular HTML with the KUIB app architecture. Specifically, how do I get the select and button elements to recognize the ng-model and ng-options attrubutes on the select, and the ng-click or onclick on the buttons? For the buttons I tried setting onclick (and ng-click) to "myFunction, "this.myFunction", and "$scope.myFunction" and I just can't get it to fire. For the select lists, I managed to get the list populated by finding the select and appending option tags. I'd much rather be able to use the ng-model and ng-options though. Example I'm starting from: jsfiddle.net/.../ The following is the contents of my custom HTML: Available Selected --> " style="width:50px;margin-left:5px" onclick="btnRight()" /> --> The following is the code in controller.public.js I'd like to use to manage the select lists: btnRight() { console.log("btnRight()"); //move selected. angular.forEach(this.SelectedAvailItems, (value, key) => { this.push(value); }, this.SelectedListItems); //remove the ones that were moved. angular.forEach(this.SelectedAvailItems, (value, key) => { for (var i = this.AvailableListItems.length - 1; i >= 0; i--) { if (this.AvailableListItems.gla_group == value.gla_group) { this.AvailableListItems.splice(i, 1); } } }); this.SelectedAvailItems = []; }; btnLeft() { console.log("btnLeft()"); //move selected. angular.forEach(this.SelectedSelectedListItems, (value, key) => { this.push(value); }, this.AvailableListItems); //remove the ones that were moved from the source container. angular.forEach(this.SelectedSelectedListItems, (value, key) => { for (var i = this.SelectedListItems.length - 1; i >= 0; i--) { if (this.SelectedListItems.gla_group == value.gla_group) { this.SelectedListItems.splice(i, 1); } } }); this.SelectedSelectedListItems = []; }; Thanks, Louis
Continue reading...
Continue reading...