Search Posts

Category: jquery

How to set checked property of checkboxes based on value from database using angular js

I have a group of checkboxes which are populated dynamically from database using AngularJs. Now, on edit I want to check the checkboxes whose value is stored in database. Below is the sample code: <div class=”row” > <div class=”col-sm-2″> <label>Select Metal :</label><label style=”color:red”>*&nbsp;</label> </div> <div class=”col-sm-8″> <div ng-repeat=”names in MetalTypes” class=”checkbox-inline” id=”MetalDiv” style=”font-size: larger; margin-left: 20px !important; margin-top: -10px !important;”> <div style=”margin:10px 10px 10px; margin-left:-16px;”> <input type=”checkbox” value=”{{names.Id}}” ng-model=”names.SELECTED” ng-checked=”object[names.Id]” ng-true-value=”‘Y'” ng-false-value=”‘N'” style=”margin-top:2px;” ng-change=”getSelectedMetal()” />{{names.Name}} […]

Expand-Collaspe Using Angular ng-grid

Hello I am trying to create a grid which expand/collaspe row when click on the column data. My grid is look like First show only first column data and all other column data is blank but their header are show. Next when click on ‘+’ icon of first column then in next row it is expand and second column data is show and all remaing are blank. Next when click on ‘+’ icon of second […]

Cannot bind event callbacks on DOM objects under a directive’s DOM element

I’m currently trying to refactor some very simple AngularJS code to move all functionality under a top-level directive. A parent element is given the directive, the directive binds the ‘mousemove’ event to that element, then goes through each child with a particular ID and binds ‘mousedown’ and ‘mouseup’ event callbacks to it. angular.module(‘DataStructureVisualizer’). directive(‘dragDrop’, function () { return { link: function ($scope, element, attrs) { var mouseLocX = 0; var mouseLocY = 0; var isElementHeldDown […]

Link json data into a JS/Jquery variable [duplicate]

This question already has an answer here: Why does my JavaScript get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not? 31 answers I am trying to link data from a json file to a js variable. What is working : I can manually write and use data like it : This is working very well … var bars = [ { lat: 48.11300540000001, lng: -1.6825228000000152, name: ‘Le Kenland’, […]

How to include a JSP page dynamically after call the function in AngularJS?

I have to include a jsp page via function but i got error” http://localhost:8888/WEB-INF/pages/app/user/seller/cmnProductSharing.jsp 404 (/WEB-INF/pages/error/404.jsp)” this error is show in the console tell me sir how to fix this? $scope.getConnectedSharedBuyer = function(event, index, product) { var htmlcontent = $(‘#cmnProductSharingPage’); htmlcontent.load(‘/WEB-INF/pages/app/user/seller/cmnProductSharing.jsp’); } <div ng-if=”sellerProductObj.productType == ‘private'”> <a href=”#” title=”shared users List” data-toggle=”modal” data-target=”#groupModal” ng-click=”getConnectedSharedBuyer($event, $index, sellerProductObj)” > <i class=”material-icons”></i> </a> </div> Source: AngularJS

How to identify the difference between file and folder ondropping in javascript?

I have a container which allows dropping of files and folder. I want to identify the drop item type( file or folder ) and the exact folder or file path of dropped item. Note: I am able to get item details if I use webkitGetAsEntry() but I don’t want to use this. Someone suggested me to use files[0].size == 4096 ( for identifying folder) and its not giving exactly 4096. Its varying. Thanks in advance. […]

HTML: Freeze few selected rows in table when scroling

I have table with header and checkbox fields <table> <thead> <tr> <th>title 1</th> <th>title 2</th> </tr> </thead> <tbody> <tr ng-repeat=”value in values | orderBy: checked”> <td> <input type=”checkbox” ng-model=”value.checked”> </td> <td>{{value.text}}}</td> </tr> </tbody> </table> So when I click on the checkbox, it moves up. The problem is that i need to freeze the rows in which the checkbox is clicked. If look at similar tasks, all are advised to use a position=fixed – but if […]

angular.js ui-calendar: using prev/next methods with external buttons

I’m using ui-calendar directive. I want to use external buttons for prev and next buttons like this: $(‘#my-prev-button’).click(function() { $(‘#calendar’).fullCalendar(‘prev’); }); $(‘#my-next-button’).click(function() { $(‘#calendar’).fullCalendar(‘next’); }); I expect these buttons to navigate one month up or down, but when I click on they, multiple clicks are thrown, resulting in moving two months (sometimes more) away instead of one. To make work this code I placed it inside the viewRender function, which I suspect is the cause […]

Next Page »