Quantcast
Channel: Infragistics Community
Viewing all 2398 articles
Browse latest View live

Simplifying Angular Data Binding to .NET Developers

$
0
0

At my job, I get the opportunity to talk to many .NET developers who want to learn Angular. Often, I’ve seen that they bring their .NET skills and work to map that in the learning of Angular. While the effort and drive to learn is there Angular is not .NET.

Since Angular is a pure JavaScript library, I’ll simplify basic but important concepts of Angular to .NET developers in this post series.  

In this article, we’ll learn about Data Bindings in Angular. Luckily, Data Binding in Angular is much simpler than in .NET.  

First, Let’s revise some of data binding techniques in .NET. For example, in ASP.NET MVC, you do data binding using a model. View is bound 

  1. To an object
  2. To a complex object
  3. To a collection of objects

Essentially, in ASP.NET MVC, you do data binding to a model class. On the other hand, in WPF, you have data binding modes available. You can set the mode of data binding in XAML, as follows:

  1. One-way data binding
  2. Two-way data binding
  3. One-time data binding
  4. One-way to source data binding

If you are following MVVM patterns, then you might be using INotifyPropertyChanged interface to achieve two-way data binding. Therefore, there are many ways data bindings are achieved in world of .NET.

 Data binding in Angular, however,  is much simpler.

If you are extremely new in Angular, then let me introduce you to Components. In Angular applications, what you see in the browser (or elsewhere) is a component. A component  consists of the following parts:

  1. A TypeScript class called Component class
  2. A HTML file called Template of the component
  3. An optional CSS file for the styling of the component

In Angular, Data Binding determines how data will flow in between Component class and Component Template.

Angular provides us three types of data bindings. They are as follows:

  1. Interpolation
  2. Property Binding
  3. Event Binding

Let’s see each one by one.

Interpolation

Angular interpolation is one-way data binding. It is used to pass data from component class to the template. The syntax of interpolation is {{propertyname}}.

Let’s say that we have component class as shown below:

export class AppComponent {
 
      product = {
          title: 'Cricket Bat',
          price: 500
      };
 
  }

We need to pass the product from the component class to the template. Keep in mind that to keep example simple, I’m hard coding the value of the product object, however, in a real scenario, data could be fetched from the database using the API.  We can display value of the product object using interpolation, as shown in the listing below:

<h1>Product</h1> <h2>Title : {{product.title}}</h2> <h2>Price : {{product.price}}</h2>

Using interpolation, data is passed from the component class to the template. Ideally, whenever the value of the product object is changed, the template will be updated with the updated value of the product object.

In Angular, there is something called ChangeDetector Service, which makes sure that value of property in the component class and the template are in sync with each other.

Therefore, if you want to display data in Angular, you should use interpolation data binding.

Property Binding

Angular provides you with a second type of binding called “Property Binding”. The syntax of property binding is the square bracket []. It allows to set the property of HTML elements on atemplate with the property from the component class.  

So, let’s say that you have a component class like the one below:

export class AppComponent {
 
       btnHeight = 100;
       btnWidth = 100;
   }

Now, you can set height and width properties of a button on template with the properties of the component class using the property binding.

<button 
  [style.height.px] = 'btnHeight'    [style.width.px] = 'btnWidth' >        Add Product
</button >

Angular Property Binding is used to set the property of HTML Elements with the properties of the component class. You can also set properties of other HTML elements  like image, list, table, etc.  Whenever the property’s value in the component class  changes, the HTML element property will be updated in the property binding.

Event Binding

Angular provides you third type of binding to capture events raised on template in a component class. For instance, there’s a button on the component template and, on click of the button, you want to call a function in component class. You can do this using Event Binding. The syntax behind Event Binding is (eventname).

For this example, you might have a component class like this:

export class AppComponent {
 
     addProduct() {
         console.log('add product');
     }
 
 }

 

You want to call addProduct function on the click of the button on the template. You can do this using event binding:

 
<h1>Product</h1><button (click)='addProduct()'>    Add Product
</button>

You can do event binding with all events of a HTML elements which is part of Angular ngZone. You can learn more about it here.

Angular provides you these three bindings. In event binding, data flows from template to class and, in property binding and interpolation, data flows from class to template.

Two-Way Data Binding

Angular does not have built-in two-way data binding, however, by combining Property Binding and Event Binding, you can achieve Two-Way Data Binding.

Angular provides us a directive, ngModel, to achieve two-way data binding, and It’s very easy to use. First, import FormsModule and then you can create two-way data binding:

export class AppComponent {
 
     name = 'foo';
 }

 

We can two-way data bind the name property with an input box:

<input type="text" [(ngModel)]='name' /><h2>{{name}}</h2>

As you see,  we are using [(ngModel)] to create two-way data binding in between input control and name property. Whenever a user changes the value of the input box, the name property will be updated and vice versa.

As a .NET developer, now you might have realized that data binding in Angular is much simpler, and all you need to know is four syntaxes. I hope you find this post useful and, in further posts, we will cover other topics of Angular.  

 If you like this post, please share it. Also, if you have not checked out Infragistics Ignite UI for Angular Components, be sure to do so! They have 30+ material based Angular components to help you code web apps faster.


Using Inedo’s ProGet to Manage Infragistics NuGet Packages

$
0
0
Infragistics' Xamarin and Inedo's ProGet to manage NuGet packages.(read more)

Working with Firebase Firestore and the Ignite UI for Angular Grid

$
0
0

In this article, w’ll learn to use Firebase Firestore and the Ignite UI for Angular Grid. The Firestore is Firebase NoSQL database offering so, before you start, I recommend that you to learn more about both Firestore and Ignite UI for Angular.

In this article, we’ll learn to read data from Firestore and bind that data to the Ignite UI for Angular Grid. In next article for this topic, w’ll move through Create, Delete, and Update operations.

So, let’s begin with setting up Firestore, creating Angular project to work with Ignite UI for Angular, and then fetching data from Firestore.

Setting up Firestore

 

You’re going to navigate to the Firebase console. When you’re there, click on the “Add project” option.

After clicking on “Add project”, you will get a dialog window to provide project information. Enter into that to create project as shown in the image below. Here, I have given the project name iggridemo.

Once project is created, you need to add an app to the project. We’ll add a web project, as we’re going to use Firestore data collection inside Angular, which is a web project.

As you click on the web option, you’ll get snippet to add to your project. Copy this snippet, since you may need it later to add into an Angular project.  

Note:  We will add the below setting in Angular project environment.prod.ts file.

Next, click on “Database” in the side menu options and create a collection. Keep in mind that Firestore is NoSQL based database. Here we create collections to work with data. To create a database, go to the side menu and click on database, then creating the database. You’ll be asked to select your security rules. Select option “Start in test mode” and click on “Enable”.

After setting up security rules, click on “Add collection” to add a collection to the database.

Give a name to the collection. For this example, I gave the name here “products”.

After creating the collection, add a document. I’m adding a document in the products collection, as shown in the image below:

After adding first document, the database should look like this: 

Now, let’s add a few more documents to the collection. For that action, click on “Add document” in the products collection. 

 

So, I’ve added five documents to the products collection. We’re going to work with the products collection now in the Ignite UI for Angular Grid. So far, we’ve only created the collection in Firebase Firestore.

Setting up an Angular project with Ignite UI

We have three options for setting up anAngular project with Ignite UI for Angular.

  1. Use Ignite UI CLI to create a new Angular project configured with Ignite UI for Angular.
  2. Use Ignite UI for Angular in an existing Angular project.
  3. Use Ignite UI for Angular Toolbox Extension for Visual Studio Code.

 From this point forward, I’ll assume that you already have an Angular project configured to work with Ignite UI for Angular.  

Setting up AngularFire

We’re going to use the AngularFire library to work with Firebase in an Angular projectTo start, install AngularFire in the Angular project using npm.

 npm install firebase @angular/fire --save 

After installing Angularfire, we need to setup a Firebase environment. To do that, open environment.prod.ts and modify it, as shown below:

export const environment = {
    production: false,
    firebase: {
        apiKey: "yourkey",
        authDomain: "iggriddemo.firebaseapp.com",
        databaseURL: "https://iggriddemo.firebaseio.com",
        projectId: "iggriddemo",
        storageBucket: "iggriddemo.appspot.com",
        messagingSenderId: "1055912852453"    }
};

If you recall from setting up Firestore, we added a web project. We need to copy that setting from there to environment.prod.ts file. If you’re working in a development environment, you may want to add the above entry in the environment.ts file. 

Next, in AppModule, import Firestore and AngularFire modules. Import in app.module.ts, as below:

import { AngularFirestoreModule } from '@angular/fire/firestore';
import { AngularFireModule } from '@angular/fire';
import { environment } from '../environments/environment';

Modify AppModule:

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        IgxGridModule.forRoot(),
        AngularFireModule.initializeApp(environment.firebase),
        AngularFirestoreModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {
}

Now, we’ve added AngularFireModule and AngularFireStoreModule in imports array.

Read Data from Firestore Collections

We’re going to read data from Firestore collections in AppComponent. First, import AngularFirestore and Observable in AppComponent.

import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';

Next, let’s fetch data in the constructor of the component:

items: Observable<any[]>;
constructor(private db: AngularFirestore) {
    
    this.items = db.collection('/products').valueChanges();
 
}

If you remember, we have created a products collection in Firestore. Putting everything together, AppComponent will look like below:

import { Component } from '@angular/core';
import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
 
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    title = 'Ignite UI for Angular Grid + Firestore';
    items: Observable<any[]>;
    constructor(private db: AngularFirestore) {
 
        this.items = db.collection('/products').valueChanges();
 
    }
}

On the template, let’s add Ignite UI for Angular Grid:

<h1>    Welcome to {{ title }}!
</h1><igx-grid [data]="items | async" [autoGenerate]="false" height="400px">    <igx-column field="Id" [sortable]="true" header="Id" [filterable]="true"></igx-column>    <igx-column field="Title" [sortable]="true" header="Title" [filterable]="true"></igx-column>    <igx-column field="Price" [sortable]="true" header="Price" [filterable]="true"></igx-column>    <igx-column field="Quantity" [sortable]="true" header="Quantity" [filterable]="true"></igx-column>    <igx-column field="inStock" [sortable]="true" header="Stock" [filterable]="true"></igx-column></igx-grid>

So, let’s talk through the code, since we:

  • Added igxGrid
  • Set data through property binding to items. Since it is an observable, we are using async pipe.
  • Set autoGenerate property to false because we are going to add columns manually.
  • Configured columns and bound it to the Firestore collection products columns.

On running the application you will find the Ignite UI for Angular Grid is displaying data from Firestore. For products, collection igxGrid should be rendered, as shown in the image below:

In next post, we will see how we can perform Create, Update, and Delete operations. I hope you find this post useful, and now you should able to work with Firebase Firestore and Ignite UI for Angular Grid with ease.

If you like this post, please share it. Also, if you have not checked out Infragistics Ignite UI for Angular Components, be sure to do so! They have 50+ Material-based Angular components to help you code web apps faster.

Designing a User Profile: How to Use Overrides

$
0
0

By Dainail Marinov

No matter the type of software project UI/UX designers have their hands on – apps for fintech, blockchain, or e-commerce – almost all projects share one screen in common. In this case, we’re talking about the part of an app containing the user’s personal info…his profile.

Yes, on the surface, everything looks like a piece of cake. We should include an image, name, password, and save button, plus various option settings. While all this holds true, this simplicity only applies to run-of-the-mill scenarios. When diving deeper into a concrete business case of a software product, the user profile screen is likely to become a bit more complicated. From inner levels to billing and verification – when it comes to the profile screen – the devil is in the details.

If you have to design a component-rich user profile case,it's time to gear up; you’ll confront a few challenges defining the best UX scenario and picking the optimal components to represent it. Then, after performing UX tests on the initial prototype iteration, it’s time for changes and improvements of the wireframes. And yes, we would need to make the wireframe improvements as soon as possible.

Furthermore, let’s stick to this familiar phrase, “As soon as possible!”, and let me show you how to use the pixel-perfect predefined Sketch Components and Indigo.Design patterns to build up our UX concept.

Let's Begin

With the initial paper sketches already done, we’re in front of the screen and ready to begin with Sketch. Here comes the first neat surprise (let’s stick to using surprise only for positive vibes):

We don’t need to lose time thinking about how to start from the blank artboard when we use Indigo.Design UI Kits, because we can simply insert one of the patterns closest to our design concept.

As a member of the Indigo.Design product team, I’m excited to create more patterns that are going to aid in a variety of use cases. So, if you have a need for a specific use case, don’t hesitate to drop us a line. You can even attach a mock-up to illustrate it better.

The next step is to configure the existing User Profile Pattern according to our specific requirements. I’m going to keep the initial pattern next to the modified one to keep track of changes:

Here is the result after choosing a different profile image representation.

From the option situated under Avatar, we can quickly define the background color of the icon in the bottom-right corner, the icon type, text color, placeholder text, etc.

As you can see, the initial pattern provides several inputs, the first of which is represented in the focus state, while the rest are in the filled state. Of course, if we want to change the state, it can be done easily from State options.

For the current example, I chose idle state, so I receive that result. What’s rather useful when specifying an input is clearly describing its behavior. For example, noting whether a password is incorrectly or successfully typed. That can be set up from State dropdown again. After choosing the state that we want, the inputs are perfectly distributed vertically.

What if we want to change the layout of the input to show boxes instead of lines? No worries, just change it like this…

…and you receive a perfect-pixel boxed input. Needless to say, if you prefer that layout, better to stick to it for all other inputs.

Moving on, what if you wanted to have more complicated inputs including suffixes, prefixes, or icons? Our library provides easily editable templates that cover several cases. Let’s start with the initial condition.

Then, you can see how to get the input with prefix and suffix icons.

It’s likely you’ll just need to edit the icon which you can edit both for prefix and suffix color and icon type.

If we want to go even further and use another Component rather than and Input, we'll have to detach our Profile pattern and edit the smaller components. 

 

Very often we need a switch option when editing a profile, so let’s add and edit such a component from the Indigo library.

Since the pattern is already detached, I recommend deleting an input after adding another option, to use it as a base point for alignment.

After precise alignment, you can just stretch the switch component to fit between the offset.

Finally, just delete the input or field that you don’t need and edit the switch label.

In case of more complicated profile settings, we may need to add an item that navigates the user to another screen or deeper level. If we face this case, I recommend using a list item.

First, we add it as a component from the library, then we put it wherever we want on the screen and simply adjust its width to fix the screen size. Finally, don’t forget to change the label.

An important note that I would like to add: Don’t add a component from the Overrides menu. I know it is very tempting since it is positioned on the top of the components list, but it’s better first to add the initial form of the component than to configure it from the right option panel.

That’s all! As promised, using our Sketch UI library speeds up your productivity. But that’s just the beginning, as more exciting Indigo.Design capabilities (such as how to code generate your design) will be revealed in upcoming articles.

Infragistics Windows Forms Release Notes - September 2018: 17.2, 18.1 Service Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

Windows Forms 2017 Volume 2 Service Release (Build 17.2.20172.2097)

PDF - Infragistics for Windows Forms 2017 Volume 2
Excel - Infragistics for Windows Forms 2017 Volume 2

Windows Forms 2018 Volume 1 Service Release (Build 18.1.20181.237)

PDF - Infragistics for Windows Forms 2018 Volume 1
Excel - Infragistics for Windows Forms 2018 Volume 1

Windows Forms UI Controls

Infragistics WPF Release Notes - September 2018: 17.2, 18.1 Service Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

WPF 2017 Volume 2 Service Release (Build 17.2.20172.2188)

PDF - Infragistics for WPF 2017 Volume 2
Excel - Infragistics for WPF 2017 Volume 2

WPF 2018 Volume 1 Service Release (Build 18.1.20181.237)

PDF - Infragistics for WPF 2018 Volume 1
Excel - Infragistics for WPF 2018 Volume 1

WPF UI Controls

How to add a static member property in a JavaScript class?

$
0
0

Recently while solving a problem, I came across a requirement to create a property in a JavaScript class, which needs to be shared by all the object instances. In the programming world, these types of properties are called Static Properties.

There are various scenarios when you need a static member property:

  • When counting number of object instances created from a particular class
  • When logging some information at the class level instead of object instance level, etc.

To create a static property, you should know two important things:

  1. A JavaScript class cannot have a member property. You can only create it using a constructor
  2. Like the function constructor, a JavaScript class also has a prototype

Well, if you are a champion of prototypes, you must have guessed the answer in your mind by this time.  Any way, let us move forward to see the implementation,

class Foo {
 
    constructor(goal) {
        this.goal = goal;
        Foo.prototype.objectcount++;
    }
 
}
Foo.prototype.objectcount = 0; 

 

Let us talk through the implementation of Foo class,

  1. We added a property to the Foo class prototype
  2. Incremented it in the constructor, as the constructor would be called each time an object is created

Essentially to create a static property member, add a property to class prototype object.  Now, creating an instance of Foo class,

let f1 = new Foo(78);
console.log(f1.objectcount); // 1
let f2 = new Foo(45);
console.log(f2.objectcount)// 2
let f3 = new Foo(45);
console.log(f3.objectcount)// 2
console.log(f1.objectcount === f2.objectcount);// true 
console.log(f2.objectcount === f3.objectcount);// true 

You can see that now objectcount keeps a track of the count of all the objects. It is the same for all the object instances as well, hence, it can be termed as a static member property of a JavaScript class.

I hope you find this quick tip useful. 

Infragistics ASP.NET Release Notes - December 2018: 17.2, 18.1, 18.2 Service Release

$
0
0

With every release comes a set of release notes that reflects the state of resolved bugs and new additions from the previous release. You’ll find the notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

Note: This is the last service release for Infragistics ASP.NET 17.2

Download the Release Notes

ASP.NET 2017 Volume 2

ASP.NET 2018 Volume 1

ASP.NET 2018 Volume 2


Ignite UI Release Notes - December 2018: 17.2, 18.1, 18.2 Service Release

$
0
0

With every release comes a set of release notes that reflects the state of resolved bugs and new additions from the previous release. You’ll find the notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

Note: This is the last service release for Ignite UI for JavaScript 17.2

Download the Release Notes

Ignite UI 2017 Volume 2

Ignite UI 2018 Volume 1

Ignite UI 2018 Volume 2

Two Problems of a JavaScript Class

$
0
0

Starting ECMA 6, JavaScript has class keyword to create a class. I have written in detail about class here. There is no second question that class simplifies the way object is created, inheritance is implemented etc. JavaScript class has,

  • Constructors
  • Methods
  • Extends etc.

Above features of a class helps to easily write Object Oriented JavaScript. As a developer, you do not need to know complexities of prototype chains, relationship between function constructor and its prototype object, and value of object’s __proto__ properties etc. to write effective Object Oriented JavaScript.  So, class keyword  is good addition to JavaScript language, however it is not gospel perfect. It has some problems, which may restrict you to write full-fledged Object Oriented JavaScript. In this post, I am going to share two such problems. Read along,

No Static Member Properties in class

A static member property is shared by all object instance of the class. JavaScript class does not allow creating it inside the class.

You cannot declare properties directly in the class. You can only have it through class’s constructors, and properties created inside constructor is local to the object instances and not shared by all of them.

class Car {
 
	var a = 9; // unexpected indentifier error 
}

Above code will throw error “unexpected identifier”.  There is a work around to create static property using the class prototype.

class Speaker {
    constructor(name) {
            Speaker.prototype.count++;
            this.name = name;
        }
    }
Speaker.prototype.count = 0; 

Now on the instances of Speaker class, you can access static property count.

var a = new Speaker('dj');
var b = new Speaker('Jason');
 
console.log(a.count); // 2
console.log(b.count); // 2
console.log(a.count === b.count) // true 

Therefore, you are able to create a static property, but not without help of understanding of prototype.  In my opinion class should have a way to create static property directly inside the class like a method or constructor.

Object instances does not copy definitions from class

To understand this problem, let us first revise Constructor Invocation Pattern and prototype chain. You have a function constructor Speaker.

function Speaker(name) {
    this.name = name;
    this.hello = function () {
        console.log('hey ' + this.name);
    }
}

Using new operator, you can create object instances,

var a = new Speaker('dj');
a.hello(); // hey dj 
var b = new Speaker('Jason');
b.hello(); // hey Jason

In this approach, a and b object instances both have their own copy of hello method.  Now if you add a hello method to Speaker.prototype, still a and b object instances will access their own copy of hello method. Consider below code:

Speaker.prototype.hello = function () {
    console.log('Hello Speaker ' + this.name);
}
 
a.hello(); // hey dj 
b.hello(); // hey Jason 
a.__proto__.hello.call(a); // Hello Speaker DJ 

You are getting expected output while calling hello method and to call hello method of Speaker prototype use __proto__.

Now let us implement above scenario using class.

class Speaker {
 
    constructor(name) {
        this.name = name;
    }
    hello() {
        console.log('hey ' + this.name);
    }
}

We have created Speaker class with a constructor and an instance method hello. Let us create object instances of Speaker class,

var a = new Speaker('dj');
a.hello(); // hey dj 
var b = new Speaker('Jason');
b.hello(); // hey Jason

So far, everything is as expected. Now go ahead and add same function hello to Speaker prototype.

Speaker.prototype.hello = function () {
    console.log('hello speaker  ' + this.name);
}

After adding function hello to speaker prototype, call hello function with object instances of Speaker.

a.hello(); // hello speaker dj 
b.hello(); // hello speaker jason 

You will find surprised output that object instances a and b are now calling hello function of Speaker prototype instead of their own hello function.

This is happening because JavaScript class is not like real class of object-oriented language. It does not create copy of class declaration in objects. It is still using the live delegation model based on [[Prototype]]

 Besides, above two problems in class, there are others too. One is related to super keyword which we will discuss in further article. I would recommend you to learn more about class, function constructor, and prototypes before deciding which one you should use.

Infragistics Ignite UI for JavaScript

Infragistics Windows Forms Release Notes - December 2018: 17.2, 18.1, 18.2 Service Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

Windows Forms 2017 Volume 2 Service Release (Build 17.2.20172.2115)

PDF - Infragistics for Windows Forms 2017 Volume 2
Excel - Infragistics for Windows Forms 2017 Volume 2

Windows Forms 2018 Volume 1 Service Release (Build 18.1.20181.305)

PDF - Infragistics for Windows Forms 2018 Volume 1
Excel - Infragistics for Windows Forms 2018 Volume 1

Windows Forms 2018 Volume 2 Service Release (Build 18.2.20182.175)

PDF - Infragistics for Windows Forms 2018 Volume 2
Excel - Infragistics for Windows Forms 2018 Volume 2

Windows Forms UI Controls

Infragistics Ultimate UI for WPF: 17.2, 18.1, 18.2 Service Release Notes - December 2018

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

WPF 2017 Volume 2 Service Release (Build 17.2.20172.2217)

PDF - Infragistics for WPF 2017 Volume 2
Excel - Infragistics for WPF 2017 Volume 2

WPF 2018 Volume 1 Service Release (Build 18.1.20181.324)

PDF - Infragistics for WPF 2018 Volume 1
Excel - Infragistics for WPF 2018 Volume 1

WPF 2018 Volume 2 Service Release (Build 18.2.20182.186)

PDF - Infragistics for WPF 2018 Volume 2
Excel - Infragistics for WPF 2018 Volume 2

WPF UI Controls

Simplifying Object.assign method in JavaScript

$
0
0

“In JavaScript, Object’s assign method copies source object’s own enumerable properties to a target object, and returns that target object “

There are two important keywords in the above sentence:

  1. Enumerable
  2. Own

Before we go ahead and understand purpose of Object.assign, it is essential that we really understand these two words, enumerable properties and own properties.  Let us see them one by one:

A JavaScript object could have either enumerable or non-enumerable properties. However, by default when you create property on an object, it is enumerable.  Enumerable  means you can enumerate through those properties. Let us understand it through code.

const babycat = {
 
    age: '1',
    color: 'white'
 
}
 
for (var prop in babycat) {
    console.log(prop);
}

There are two properties in babycat object. By default both are enumerable, hence as the output of for..in loop, you will get both age and name printed.

 Now let us change default enumerable behavior of age property using Object.defineProperty method.

const babycat = {
 
    age: '1',
    color: 'white'
 
}
 
Object.defineProperty(babycat, 'age', { enumerable: false });
 
for (var prop in babycat) {
    console.log(prop);
}

We have changed enumerable of age property to false, so as output, you will get only color printed. Hence, age is no longer an enumerable property of babycat object.

 Another keyword in above sentence is own properties. To understand it, you need to understand object prototype chain. All JavaScript objects are part of a prototype chain, hence can access properties of its prototype’s also.  So, own properties are those properties, which are particular to the object and not from the prototype chain.  Let us understand own properties through code examples,

const cat = {
    name: 'foo'
}
 
const babycat = {
    age: '1',
    color: 'white'
}
 
//babycat.__proto__ = cat; // I love this more 
Object.setPrototypeOf(babycat, cat);
 
for (var prop in babycat) {
    console.log(prop);
}

In above code snippet, there are two objects cat and babycat. In addition, [[Prototype]] property of babycat object is set to cat object. When you print properties of the babycat object using for..in loop, you will find as output age, color, name printed as shown in below image:

 What is happening here? Well, JavaScript prints all properties from the prototype chain. However, only age and color are, own properties of babycat object. As of now, you should have understood own properties and enumerable properties in context of a JavaScript object.   So let us revisit first statement of this post,

“In JavaScript, Object’s assign method copies source object’s own enumerable properties to a target object, and returns that target object “ . You should able to infer what exactly above sentence implies.  Consider code below :  

const cat = {
 
    name: 'foo'
}
 
const babycat = Object.assign({}, cat);
 
for (var prop in babycat) {
    console.log(prop + ':' + babycat[prop]);
}

Using Object.assign() method , we are copying cat object own enumerable properties to babycat object. Here, cat object is source and babycat object is target. You will get output printed as below:

The Object.assign() method uses [[Get]] on the source object and [[set]] on the target object and invokes setter and getter to perform the task. Essentially, it assigns properties values from source to target object. It does not create new property in the target object. As of now you know purpose of the Object.assign() method. Let us examine some variations while copying properties from source object to a target object.

Same Properties in both target and source object

If target object has same properties as of source object, then Object.assign() method will  override target object properties.  To understand it consider code listing below:

const cat = {
 
    name: 'foo',
    age: 9
}
 
const babycat = Object.assign({ age: 1 }, cat);
 
for (var prop in babycat) {
    console.log(prop + ':' + babycat[prop]);
}

There is age property in both target object and source object.  While copying properties in target object the Object.assign() method will override target object age property, hence you will get output as shown in the below image :

Deep Cloning of objects

As we saw in pervious examples that, using the Object.assign() method cloning can be performed. To refresh, below code snippet perform the cloning.

const cat = {
 
    name: 'foo',
    age: 9
}
 
const babycat = Object.assign({}, cat);
 
for (var prop in babycat) {
    console.log(prop + ':' + babycat[prop]);
}

The Object.assign() copies values. Therefore, if source object has a reference type, it will copy reference value. Let us understand it through code:

const cat = {
 
    name: 'foo',
    age: 9,
    child: {
        nochild: 2
    }
}
 
const babycat = Object.assign({}, cat);
 
console.log(cat.name); // foo
console.log(babycat.name); // foo 

console.log(cat.child.nochild); // 2
console.log(babycat.child.nochild); // 2

babycat.name = 'koo';
babycat.child.nochild = 9;
 
console.log(cat.name); // foo
console.log(babycat.name); // koo 

console.log(cat.child.nochild); // 9
console.log(babycat.child.nochild); // 9

In above example, the Object.assign will copy

  • Value of name and age
  • Value of reference of child as it is of reference type.

Since for name property only value is copied, when you change its value in babycat object, it does not affect cat object’s name property. However, when you change value of child property on the babycat object, it changes value of cat object also because of its reference type nature.  As expected when you run above sample, you will get output as shown in the image below:

Merging more than one source objects

 Using Object.assign() method you can also merge more than one objects to a target object. Consider code listed below:

const obj1 = {
 
    a: 1
}
 
const obj2 = {
 
    b: 2
}
 
const obj3 = {
 
    c: 3
}
 
const obj4 = Object.assign({}, obj1, obj2, obj3, { d: 4 });
for (let p in obj4) {
    console.log(obj4[p]);
}

We are merging obj1, obj2, obj3, and unnamed object to target object obj4.  You will get output printed as below:

Null and undefined

 JavaScript Object.assign() method ignores null and undefined while copying objects. Consider code listed below:

const obj1 = {
 
    a: 1
}
 
const obj2 = Object.assign({}, obj1, null, undefined, { d: 4 });
for (let p in obj2) {
    console.log(obj2[p]);
}

 As output, you will get 1 and 4 printed because assign method ignores undefined and null.

You should use JavaScript Object.assign() method to copy source object’s own enumerable properties to target object. It does clone objects, by copying value from the source object.

How to enable Column Hiding in Ignite UI for Angular Grid

$
0
0

Ignite UI for Angular Grid is fastest Angular Grid out there.  It does not only run fast, it is also very easy to use igxGrid in your application. Ignite UI for Angular Grid component class is named as igxGrid and on the template it can be used as <igx-grid></igx-grid>

Learn more about Ignite UI for Angular Grid here

In this blog post, let us learn that how Column Hiding can be enabled in IgniteUI for Angular Grid.  

Step 1:  Add Ignite UI for Angular in  Angular Project

There are three ways to add an igx-grid to an Angular project:

  1. If starting a new project, use the Ignite UI CLI to scaffold the project. You can use command line options to add the igx-grid, including dependency installation.
  2. In an existing project, you can use the Ignite UI for Angular Toolbox Extension to add an igx-grid in the project. Learn how in this blog post.
  3. You can use npm to install Ignite UI for Angular dependencies in your project. You can learn that in details here :  Step-by-Step with Images to Add Ignite UI for Angular in an Existing Angular Project

Step 2:  Add igx-grid to an Angular Project

To work with igxGrid, you need to add

  1. igxGridModule
  2. BrowserAnimationModule
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { IgxGridModule } from 'igniteui-angular';

After importing pass these two modules to imports array of Module. Next, to bind with igxGrid, let us create a local data source in the component.

getData() {
    return [
        { model: 'BMW', color: 'Black', price: '20000' },
        { model: 'Audi', color: 'Blue', price: '10000' },
        { model: 'Merc', color: 'Red', price: '25000' },
        { model: 'Toyta', color: 'Green', price: '18000' },
        { model: 'GM', color: 'Blye', price: '10000' },
    ];
}

If you want to learn how to work with REST based API and igxGrid, follow four simple steps to working with Ignite UI for Angular Grid and REST Service

 In the ngOnInit life cycle hook of the component, read data from getData() function as shown in the code listed below. We will  set data source of igxGrid to localData using property binding on the template.

ngOnInit() {
    this.localData = this.getData();
}

Add igxGrid on the template as shown in the code listing below.  We are explicitly configuring columns such that, we can work with column hiding feature.

<igx-grid #grid1 id="grid1" [data]="localData" [autoGenerate]="false">    <igx-column field="model" header="Maker"></igx-column>    <igx-column field="color" header="Color"></igx-column>    <igx-column field="price" header="Price"></igx-column></igx-grid>

In above igxGrid;

  1. Columns are configured manually
  2. Datasource is set using [data] property binding to localData
  3. Since columns are configured manually, autoGenerate is set to false.

At this point on running application, you will get  igxGrid in Angular application as shown in image below:

Step 3:  Enable Column Hiding

Ignite UI for Angular Grid, place column hiding UI in the grid’s toolbar. You can use grid’s tool bar dropdown to show or hide columns.  So first step you need to is set showToolbar of grid to true.

<igx-grid .... [showToolbar]="true" toolbarTitle="Cars" ...></igx-grid>

After setting showToolbar to true, you need to set columnHiding to true.

<igx-grid .... [columnHiding]="true" ...></igx-grid>

By setting combination of showToolbar and columnHiding, you can work with column hiding in igxGrid. Putting everything together,  with column hiding and manual column configuration igx-grid will look like as shown in the code listing below:

<igx-grid #grid1 id="grid1" [data]="localData" [autoGenerate]="false"            [showToolbar]="true" toolbarTitle="Cars" [columnHiding]="true">      <igx-column field="model" header="Maker"></igx-column>      <igx-column field="color" header="Color"></igx-column>      <igx-column field="price" header="Price"></igx-column>  </igx-grid>

 

At this point on running application, you will find igxGrid rendered as shown in the image below:

You can also disable a column from hiding by setting [disabledHiding] property to true. So  you can disable hiding of a columns model as shown in the code listing below:

<igx-grid #grid1 id="grid1" [data]="localData" [autoGenerate]="false"          [showToolbar]="true" toolbarTitle="Cars" [columnHiding]="true">    <igx-column field="model" [disableHiding]="true" header="Maker"></igx-column>    <igx-column field="color" header="Color"></igx-column>    <igx-column field="price" header="Price"></igx-column></igx-grid>

At this point on running application, you will find igxGrid rendered  with model column disabled for hiding shown in the image below:

Besides column, hiding there many IgniteUI for Angular Grid has many features, which make it, best grid for enterprise applications. Check out all features here

Now you have seen that hiding columns is as simple as setting property binding. I hope you find this post useful.

Design for a Cyber Monday Offer with Indigo.Design

$
0
0

In order to showcase how easy it is to create stunning designs with Indigo.Design, I'll walk you through on how I created my Dribbble debut shot for a Cyber Monday Offer with the Indigo.Design UI Kits in Sketch.

As you probably know by now, Indigo.Design is Infragistics' Design System including:

  • UI Kits to speed up the creative process of designers in Sketch
  • Cloud for prototypes to share ideas with stakeholders and quick collection of feedback or to create and execute in-depth remote usability studies with real users
  • Integration with Visual Studio Code allowing you to generate Angular code from your prototypes with Ignite UI for Angular

The reason for mentioning these steps is that upon finishing my work in Sketch for the Cyber Monday Offer, I went on to publish it as a prototype in the cloud via the Sketch plugin by Infragistics. Then, I fed the link in Infragistics' plugin for Visual Studio Code to generate an Angular layout component with Ignite UI for Angular icons, buttons and typographies, which is just one "npm start" from pixel-perfect rendering in the browser. This walkthrough will outline the steps on how to create the design in Sketch, however, you can also download and explore the original Sketch project from Dribbble to play with the prototype and use its link to generate an Ignite UI for Angular app.

To get started, any first time users will need to install the Indigo.Design UI Kit. We have a video guide that may come in handy if you're new to Sketch and the concept of libraries. As a note, I would advise you to update the Sketch app to the latest available version when installing our UI kits.

Our design will start with the creation of a new artboard and drawing a rounded rectangle for the background by giving it a 16px radius. Further down in the same panel on the right hand side, we will configure the "Appearance" to use a white color style so that we have a surface on top of which to lay the user interface out. In the original project, I have applied a shape mask on the background to introduce the flame cutouts from the background because I wanted to make the offer really hot, but you can skip that part if you'd like.

Next, let's focus on the top third of the layout that looks like it is arranged in a left column with product information and a right one with the discount.

First, we will add an "H4 Headline" in "Active Style" from the bottom of the insert menu, where the text styles from the Indigo-Styling library are available. The text should say "Parrot BEBOP" and it should be positioned in the top left area of the background. Below it we will insert an "H5 Headline" in "Active Style", change its text to "FPV Power", and make sure that the left borders of these two text layers align.

After fixing both width and height and pinning to the top and left both text layers, we will create a group for them - "Left Column". The resizing properties of this group should be just like for its children i.e. fixed width and height and pinned to the top and left. Now, let's add in the top right an "ExtraLarge" icon from the Icon category in the Indigo-Components library and configure its icon glyph to be a downward arrow with red, error color. An icon must have its width and height fixed, so that is what we will do, and we will additionally pin it top and left. Another text layer is necessary to display the discount amount, so this time we will use the "H1 Headline" in "Active Style", but change its color to red and the content to "42%". This text layer needs to be fixed both left and right and pinned top and right. We will create a new group "Right Column" for the last two layers, which should appear sibling to the other group and the background.

Having set the resizing of "Right Column" to fixed width and height and pinned it to the top and right, we will select both groups we have so far and create another one - "Content". Within this new group we will add all the rest of the elements as same level layers as the two groups.

Next, we have to layout the middle section with the drone image, "BUY NOW" button and "HOT DEALS" heading.

For the image all we need to do is drag and drop a photo of a drone on the Sketch canvas, size it accordingly and fix the width and height, as well as pin to the top. With the image having equal space on the left and right in relation to the "Content" group and neither being pinned left, nor right, this centered positioning will be accounted for in the generated Angular code. The same resizing rules will be applied to the button and the heading once inserted, so let's do that now.

First, we will insert a "Raised" button from the collection of "Buttons" under Indigo-Components. We will change its text to "BUY NOW" and the color of the background to error, the same red we used for the icon before. Second, is the insertion of another text style, an "H2 Headline" in "Active Style", but change the color to red just as we did for the discount value.

Last, but not least, comes the bottom section, for which we will need to insert two "H5 Headline" in "Active Style" next to each other between the flames of the cropping mask.

The left one will say "CYBER MONDAY" and will be with fixed width and height, as well as pinned left, while the right one will say "Nov 26" and will be with fixed width and height, as well as pinned right. The final thing to do for this design is to select these two layers, create a new group from them and fix its width and height, as well as pinned it to the top.

Finally, the design for a Cyber Monday Offer in Sketch is ready and in case you have followed the steps outlined in this blog, then congratulations, you made it! You have successfully create an Indigo.Design project yourself!

Get Started with Indigo.Design!

Why stop here? You may use the Indigo.Design plugin for Sketch** to publish your work to the Indigo.Design Cloud and share it to stakeholders for early feedback, create and run a full-blown remote usability study, or simply show it with the world. If you want to go the whole nine yards, download our Visual Studio code plugin and generate an Angular app with Ignite UI for Angular.

Design-prototype-generate code

Use our Essential Plan for free or upgrade to Indigo.Design Professional starting at $39/mo. Want Code Generation? Get Indigo.Design Enterprise for $99/month!

*dribbble is an invite only design community allowing you to share your work with other creatives by creating shots for each piece of work you want to share

**The Indigo.Design plugin for Sketch let's you easily publish and sync your designs with the Indigo.Design Cloud from Sketch and comes in the same archive as the UI Kit libraries


Infragistics WPF Release Notes - September 2018: 17.2, 18.1 Service Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

WPF 2017 Volume 2 Service Release (Build 17.2.20172.2188)

PDF - Infragistics for WPF 2017 Volume 2
Excel - Infragistics for WPF 2017 Volume 2

WPF 2018 Volume 1 Service Release (Build 18.1.20181.237)

PDF - Infragistics for WPF 2018 Volume 1
Excel - Infragistics for WPF 2018 Volume 1

WPF UI Controls

Infragistics ASP.NET Release Notes - September 2018: 17.2, 18.1 Service Release

$
0
0

With every release comes a set of release notes that reflects the state of resolved bugs and new additions from the previous release. You’ll find the notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

Download the Release Notes

ASP.NET 2017 Volume 2

ASP.NET 2018 Volume 1

Ignite UI Release Notes - September 2018: 17.2, 18.1 Service Release

$
0
0

With every release comes a set of release notes that reflects the state of resolved bugs and new additions from the previous release. You’ll find the notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

Download the Release Notes

Ignite UI 2017 Volume 2

Ignite UI 2018 Volume 1

Content Projection in Angular Element with Slot in Angular 7.0

$
0
0
Learn about content projection in an Angular element with slot in Angular 7. (read more)

What's New in Ignite UI for Angular 18.2

$
0
0
See What's New in Ignite UI for Angular by Infragistics. With the release of 18.2, we've made major updates to the fastest Angular data grid on the market. (read more)
Viewing all 2398 articles
Browse latest View live