Search Posts

Category: jquery-ui

How to change the scope object using Jquery UI sortable and angular.js?

I’m using Jquery UI sortable to reorder the table rows. The re-order is working as expected, but I need the re-order should change angular scope data too. Basically I need to save reordered data to backend.I’m not sure whether I should use $watch or something else to get it done. Plunker. <body ng-app=”App” ng-controller=”Ctr”> <table class=”table table-stripped”> <tbody ng-sortable> <tr ng-repeat=”data in rowData”> <td>{{data.seq}}</td> <td>{{}}</td> </tr> </tbody> </table> <br> <br> <button class=”btn btn-primary” ng-click=”getReOrderedData(rowData)”>Get Re-order […]

autocomplete ‘suggestions’ not selectable on mobile safari

js: var input = $(“input#fill”).val(); function DefaultCtrl($scope) { $scope.names = [“One item, Two item, 3 item, 4 item, Many other items”]; } angular.module(‘MyModule’, []).directive(‘autoComplete’, function($timeout) { return function(scope, iElement, iAttrs) { iElement.autocomplete({ source: scope[iAttrs.uiItems], select: function() { $timeout(function() { iElement.trigger(‘input#fill’); }, 0); } }); }; }); problem: The above works on desktop; however when viewing on mobile safari- The autocomplete will make a ‘suggestion‘ after typing begins; but the suggestion item is not selectable. It […]

AngularJS Directive – ng-model of an input changes on removing the focus

I have created a simple angular plugin for jQuery autocomplete. Everything works perfect except the following, Type php in the input, options appears for selection. Select an option by mouse or keyboard Problem Now, when click anywhere outside the input, the model value changes from actual value which is an object to a string and then blur event gets triggered. I am not sure how does the model value changes. Any help appreciated! Take a […]

Multiplication on click show into input filed with Different ID

I am designing shopping cart functionality. And Fresher in jQuery My layout is This is my design I want to when click on increment and Decrements button then increment value and decrements value multiply into input field value below is my jQuery code $(‘.increment-btn’).on(‘click’,function(){ var $counter=$(this).closest(‘td’).find(‘.counter’); var currentVal = parseInt($counter.val()); if (!isNaN(currentVal) && currentVal > 0) {$counter.val(currentVal – 1); } }); this is HTML code <table Style=”width:100%;” class=”sumtable”> <tr> <td id=”info” Style=”padding-left: 3%;width: 20%; “>Buy […]