Skip to main content

Posts

Showing posts from January, 2015

How to paging in angularjs ng-grid?

Hello everyone, I am going to share the code sample for paging to ng-grid in angularjs with respect to your custom page size.  The detail as given in the below code detail. HTML code sample ? 1 2 3 4 5 < div ng-app = "mobileApp" ng-controller = "MobileCtrl" >     < div id = "gridView" >         < div class = "ngGridStyle" ng-grid = "mobileGridView" ></ div >     </ div > </ div > <div ng-app="mobileApp" ng-controller="MobileCtrl"> <div id="gridView"> <div class="ngGridStyle" ng-grid="mobileGridView"></div> </div> </div> AngularJs code sample ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

angularjs file bulk upload using MVC 5

HTML code sample ? 01 02 03 04 05 06 07 08 09 10 11 < div ng-app = "userApp" ng-controller = "uploadUserCtrl" >      < div id = "left" >        < h6 >Select file</ h6 >         < div >             < input type = "file" file-model = "myFile" />              < button type = "button" ng-click = "uploadFile()" >                      < i class = "fa fa-cloud-upload" ></ i > Upload              </ button >          </ div >     </ div > </ div > <div ng-app="userApp" ng-controller="uploadUserCtrl"> <div id="left"> <h6>Select file</h6> <div> <input type="file" file-model="myFile" /> <button type="button" ng-click="uploadFile()&qu

angularjs ui grid show spinner loader

Hello everyone, I am going share the code sample for how to display the angularjs ui grid show spinner loader like you can see the below image. For live demo go to http://embed.plnkr.co/QHrEECtSYNaSkjSgdksr/preview The Out-Put look like below ng-grid view image. HTML show loader code-sample ? 01 02 03 04 05 06 07 08 09 10 11 12 < div ng-app = "userApp" >      < div ng-controller = "UserCtrl" >          < div class = "col-md-3" >              < div class = "input-group  pull-right" >                  < img class = "spinner" ng-show = "loading" src = "~/Content/img/loding.png" />              </ div >          </ div >          < div id = "gridView" >              < div class = "ngGridStyle" ng-grid = "mobileGridView" ></ div >          </ div &g

create custom rules in jquery validation

? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 //Create custom rule in jquery validation    var applyRule = function () {          if ($scope.Email) {              return true ;          } else {              return false ;          }      };      $( "#editM-form" ). validate ({          // Rules for form validation         onkeyup: true ,          rules: {              email: {                  required: applyRule(),                  email: applyRule()              }          },          // Messages for form validation          messages: {              email: {                  required: 'Please enter your email address' ,                  email: 'Please enter a VALID email address'              }          },          // Do not change code below          errorPlaceme

AngularJs Confirm Password Validation

AngularJs code-sample Live Demo ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 var app = angular.module( "app" , []);      app.controller( "confirmCtrl" , function ($scope) {        $scope.user = {          password: "" ,          confirmPassword: ""        };      });      app.directive( "compareTo" , function () {        return {          require: "ngModel" ,          scope: {            confirmPassword: "=compareTo"          },          link: function (scope, element, attributes, modelVal) {            modelVal.$validators.compareTo = function (val) {              return val == scope.confirmPassword;            };            scope.$watch( "confirmPassword" , function () {              modelVal.$validate();            });          }        };      });

How to create cookies in asp net mvc and read in JavaScript

Create cookies using MVC 5 controller code-sample ? 1 2 3 4 5 6 7 private static void CreateCookies( string UID) {       System.Web.HttpCookie cookie =   System.Web.HttpContext.Current.Request.Cookies[ "UIDCookie" ] ??       new System.Web.HttpCookie( "UIDCookie" );       cookie.Values[ "UID" ] = Convert.ToString(UID);               System.Web.HttpContext.Current.Response.Cookies.Add(cookie); } private static void CreateCookies(string UID) { System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies["UIDCookie"] ?? new System.Web.HttpCookie("UIDCookie"); cookie.Values["UID"] = Convert.ToString(UID); System.Web.HttpContext.Current.Response.Cookies.Add(cookie); } Read cookies using JavaScript code-sample ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24