Quantcast
Channel: SharePoint Journey
Viewing all 542 articles
Browse latest View live

Making Rest API Call Using AngularJS From Office 365 SharePoint Hosted App To Host Web/Parent Web Application

$
0
0
The name "apps for SharePoint" is changing to "SharePoint Add-ins"
  • Get URL’s
HostWebURL and AppWebURL, which can be obtained from the query string, once the add-ins are deployed.
JavaScript code given below is used to get the value from the URL.
  1. var hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));  
  2. var appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));  
  3.   
  4. function getQueryStringParameter(urlParameterKey) {  
  5.     var params = document.URL.split('?')[1].split('&');  
  6.     var strParams = '';  
  7.     for (var i = 0; i < params.length; i = i + 1) {  
  8.         var singleParam = params[i].split('=');  
  9.         if (singleParam[0] == urlParameterKey) return decodeURIComponent(singleParam[1]);  
  10.     }  
  11. }   
  • Load SP.Requestor.js file and execute the function, once the file is loaded and execute CrossDomainRequest.
When we create new SharePoint add-in initially, we will get an error while making AJAX call, using jQuery or $http call, using AngularJS.
403 -Access is denied error.
CROS request error.
Using JavaScript Object model and whole CRUD operation will be possible but using jQuery or AngularJS , consuming list REST API will be useful. In order to do it, we use SP.Requestor.js file, which enables us to make CROS call to SharePoint Office 365 sites.
When we use the cross-domain library, the Webpages in your add-in/app can access the data in add-in domain and the SharePoint domain. The developer site, which is used to develop an app and host SharePoint site, once the add-in is published in an app catalogue.
The cross-domain library is a client-side alternative in the form of a JavaScript file (SP.RequestExecutor.js), which is hosted in SharePoint Website, which can be referenced in add-in. The cross-domain library lets us interact with more than one domain in remote add-in page through a proxy. 
  1. var scriptbase = hostweburl + "/_layouts/15/";  
  2. $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);  
  3.   
  4. function execCrossDomainRequest() {  
  5.     var executor = new SP.RequestExecutor(appweburl);  
  6.     console.log('url' + appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle(" + "'" + listName + "'" + ")/Items?@target='" + hostweburl + "'");  
  7.     executor.executeAsync({  
  8.         url: appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle(" + "'" + listName + "'" + ")/Items?@target='" + hostweburl + "'",  
  9.         method: "GET",  
  10.         headers: {  
  11.             "Accept""application/json; odata=verbose"  
  12.         },  
  13.         success: successHandlerNew,  
  14.         error: function errorHandlerNew(error) {  
  15.             console.log('List not found' + error.statusText);  
  16.         }  
  17.     });  
  18. }  
  19.   
  20. function successHandlerNew(data) {  
  21.     var jsonObject = JSON.parse(data.body);  
  22.     var results = jsonObject.d.results;  
  23. }  



    Resolving "CEWP Not Visible In Web Part Gallery" Issue In SharePoint Online / Office 365

    $
    0
    0
    On a SharePoint Online site, we have created a Team site collection. Since we need to do a small POC and use the Content Editor WebPart (CEWP), we edit the page and click Add WebPart option. I wondered what would happen since there were only few WebParts to be added, as shown below.

    SharePoint
    Figure 1: No CEWP
    Also, there were no search related Web parts and it seems to be missing other categories as well. My first thought was activating the publishing feature. Hence, I went and activated both the publishing features Site level and Web level but found no luck.
    Solution- After searching on Google, I found that this issue is related to a new feature in SharePoint Online called Custom Script. This feature enables or disables the scripting capabilities on the site.
    Options from UI for enabling and disabling this feature are available on SharePoint admin center site, as shown below.

    SharePoint
    Figure 2: SharePoint admin site - option to enable or disable the custom scripting
    If we do the setting from SharePoint admin center site, this setting is applied to all the site collections available in the tenant but if on some sites, we don’t want this feature, then we can do this setting on site collection level also.
    Also, if we do this setting from SharePoint admin center site, it takes around 24 hrs. to take the effect.
    To have an immediate effect, we need to apply the setting at site collection level. At site collection level, we can apply setting, using PowerShell command.
    Set-SPOsite is a PowerShell command, which we need to use to set the setting.
    Steps to enable the Custom Script feature at site collection level, using PowerShell command:
    1. Open the “SharePoint Online Management Shell” and run it as an administrator.
    2. Connect to Office 365, using PowerShell command “Connect-SPOService” as
    Connect-SPOService -Url https://prasham1-admin.sharepoint.com <SharePoint admin center URL>
    This command will prompt for the credentials, as given below.

    SharePoint
    Figure 3: SharePoint Online Management Shell - Credential prompt for connecting to Office 365
    1. Once the credentials are entered, we are ready to run our next command Set-SPOsite as
    Set-SPOSite <Site Collection URL for which we need to change the setting> -DenyAddAndCustomizePages 0 (“DenyAddAndCustomizePages” set to Zero means enabling the custom scripting on the given site collection.)
    Thus, we used given PowerShell command. We applied the setting for our site collection. We refreshed the page and again tried to add CEWP and we can see the CEWP as well other WebParts also, as given below.

    SharePoint
    Figure 4: Adding CEWP on page after enabling custom script feature at our site collection level
    Not only CEWP but other WebParts like Script Editor, Silverlight Web Part in category “Media and Content” are also visible. WebParts from other categories like Business Data, Content Rollup and Search are also visible.
    There are more other features also, which are affected because of Custom Scripts feature. Kindly refer https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f?ui=en-US&rs=en-US&ad=US , in this article its very detailed explained all the features which are affected.

    Overview Of Office 365 Structure And Add User Account

    $
    0
    0
    Left navigation bar
    • You can reach most Office 365 apps by clicking App launcher in the left corner of Office 365 navigation bar.
    • Click on a tile to go to the particular app. Apps and admin panel will display and accessible only on users access level permissions.
    • The image given below shows various running apps like Mail, Calendar, People, SharePoint, Planner and many more.

      Office 365
    Office 365 Admin Center
    When you click Admin tile in the App launcher, it will redirect to Office 365Admin center, where you can manage Office 365 tenant.

    Office 365
    Right Navigation bar
    • Let's see on the right side of the navigation bar in Office 365 page, where there are some icons, which exhibits own activity.

      Office 365
    • Here, you can find an alert notification icon for receiving alerts for your Office 365 tenant and subscription from Microsoft.
    • In Office 365 setting, you can manage your site settings like themes, start page, language and time zone, app settings. Meanwhile you can also change your login password.
    • Question mark icon indicates help from Office 365 as tell us what you want to do. Also, you can find Community, legal and privacy links resides in it.
    • Lastly by clicking my account name, you will get all information about your account and sign out activity. Also, you can add more information about yourself and your account.
    Add user
    • To create a new user, you need to be an Office 365 administrator.
    • Let’s add user into your Office 365 tenant. On Admin center page, under Active users, click plus (+) button to Add a user. Click it and account wizard will be displayed.

      Office 365
    • Fill out all the details and click Create.

      Office 365
    • The user account has been successfully created with a username and password generation.
    • User will get login details by an E-mail to the users specific E-mail address.
    • Lastly, you can edit or delete the account by active user’s dashboard.
    In this way, you will be in the complete phase of Office 365 building blocks. Now, you can set up Office 365 account. Perform the app launcher. Also, set up new user into Office 365 tenant. Great.

    Office 365
    The image given below displays Office 365 basic building blocks.

    Office 365
    Introduction of Office 365
    • Office 365 is a Cloud based Service. It supports both Cloud and Hybrid environments. Many of the aspects in Office 365 have specific ability and functionality as Exchange Online Service uses EXODS to information hold about the public folders like mail.
    • Many Applications run consecutively inside Office 365 like SharePoint Online (SPODS), Skype for Business Online, Azure etc.
    • You can setup an Office 365 one month free trial subscription.
    • Office 365 is a heart of processing engine known as Central Admin (CA), which helps in handling number of workflows tasks respectively.
    • Central Admin has the responsibility for the user’s tasks execution and perform an action on the scheduled tasks.
    • Office 365 runs wide array of apps insise it including Outlook, SharePoint Online, One Drive, Sway, Yammer, Office 365 video, Newsfeeds,Power Apps and Admin etc.

      Office 365
      Image: Office 365 apps
    Trial setup of Office 365
    Microsoft offers several different Office 365 subscriptions plans and pricing.
    • Office 365 Enterprise E3 | E5 | E1.
    • Office 365 Enterprise K1 | Premium |ProPlus.

      Office 365
      Office 365
    • Let’s start with Office-365-Enterproise-e3-business plans for free trial.
    • Please kindly refer the links given below to navigate to trial version.
      https://products.office.com/en-in/business/office-365-enterprise-e3-business-software
    • Refer the image given below. To start Trial, click Free Trial.

      Office 365
    • Fill Out the entries step wise. Click Next arrow to setup step 2 -3. Follow the rest of the steps and make the entries respectively. Finally, click Create my account.

      Office 365
    • When the account has been created, click You are ready to go. Now, you can start using Office 365 trial.

      Note
      You need to subscribe (purchase plans) Office 365 to continue when the emulation period expires.
    • These are the steps, which are needed to follow to try trial version of Office 365 site.
    Office 365 Sign In
    • Sign into Office 365 and lets go to Office 365 login page.
    • Navigate this url: https://login.microsoftonline.com/ to login.
    • Enter your provided E-mail address and password to login to Office 365.

      Office 365
    • After successfully signing in, Office 365 home dashboard will open and in this way, you can start using your Office 365 trial.
    In the next part, we will see Office 365 inside structure and add new user functionality.

    Role Of Microsoft Planner App In Office 365

    $
    0
    0
    • SharePoint is a collaboration platform, where people communicate with each other by various ways such as OneNote, Outlook, One Drive in addition to planner and many more.
    • As we see in SharePoint Online sites, the users are assigned tasks, scheduled reminders, sharing files; it means they are performing plan for team work. Microsoft provides best collaboration platform is planner to help people stay more active.
    • In Office 365, planner plays vital role for each user who planes tasks and assign to new user. Office 365 Planner manage planes creation, add task to plan, add people to your tasks, and sort out tasks.
    • An admin is responsible to handle and perform the tasks in Planner to add or remove licenses for the individual users or to disable Planner to all the users.
    • Microsoft Planner has connection link with Office 365 Groups and these are the things, which you require when you are creating new plan.It also creates a new Office 365 Group. If you are using Office 365 Groups, each group also has a plan like a Notebook calendar etc.
    • In short, at the time of new plan creation, it is also creating a new Office 365 Group.Admin or the user who is going to create plan. Make sure to delete plan will also permanently delete Office 365 Group and each thing belongs to group including conversations, groups One Drive location etc.
    • Let’s start to create new plan step by step.
    Office 365 Sign In
    • Let’s go to navigate URL- https://login.microsoftonline.com/ to login Office 365.
    • Enter your provided E-mail address and password to login Office 365.

      SharePoint
    • After successful login, on Office 365, the dashboard will appear successfully with running apps. Kindly select planner.

      SharePoint
    On clicking Planner app, it will navigate to the URL https://tasks.office.com/ to sign in Microsoft Planner.

    SharePoint
    • Click Sign in option now. Type your E-mail address or use phone number to use with Planner and say Next.

      SharePoint
    • Planner dashboard will display. Let’s start a new plan by choosing New plan.

      SharePoint
    • Fill out the entries like Name your plan, choose who can see it public or private and add a plan description. Finally, click Create Plan.
    Note
    • Private - Only members, which you add can see the plan.
    • Public- Everyone in your organization can see the plan.

      SharePoint
    Great.Your plan is ready.

    SharePoint
    • Now, you can add task by clicking plus tab (+).Type a task name, set due data of task. Also, add assignment by typing a name or an E-mail address for the assigned members for this task. Select Add task.

      SharePoint
    • Once task is added, assigned members will receive mail notification for new plan and user group creation etc.

      SharePoint
    • Added task can be look out at under my task.

      SharePoint
    • In this way, you can create new plans, add new task in it with assigned and the invited members also perform an action on task status. Simply, using Microsoft Planner, you can lookout multiple planning hub under one roof.

    Content Migration Tools for SharePoint

    $
    0
    0


    Angular CRUD Tutorial

    $
    0
    0

    Suggested Tutorials


    Apps in SharePoint

    $
    0
    0

    What are Apps?

    Over the last few years, desktops became laptops.  Laptops gave way to Notebooks. Notebooks became Ultra Books and the trend is moving towards Tablets and Smartphones.
    As a result of this, web applications are paving the way for Apps.

    Reasons for “Apps” development

    • No custom code execution on server side. It avoids application / server outages.
    • Custom code will be executed in Client-Browser, or IIS or Windows Azure, which are completely out of SharePoint’s scope.
    • The Server Object Model (SOM) code is replaced by Rest Services Client Side Object Model (CSOM) using which apps can communicate with a server. Authentication is done by OAuth.
    • Installation/updation /uninstallation of apps can be done without affecting the SharePoint site.
    • Better usability in mobile and tablets devices.
    • Takes SharePoint to the next level in terms of usability, deployment, development and hosting (Cloud).
    • Finally, everything in SharePoint 2013 is an App.

    Types of Apps for SharePoint

    SharePoint-hosted
    • Complete client-side code
    • Deployed to SharePoint On-premises, SharePoint online or in Office 365
    Provider-hosted
    • Deployed to a different on-premises server (not SharePoint) or the cloud
    Auto-hosted
    • Automatically provisions resources to SQL Azure and Windows Azure
    Diagram of a possible Hybrid approach with some components in SharePoint and others residing in the Cloud:
    apps-in-sharepoint-01

    SharePoint-hosted Apps:

    apps-in-sharepoint-02
    • App components hosted in isolated app domain
    • No server-side code – can use HTML, JavaScript and CSS

    Provider-hosted Apps:

    apps-in-sharepoint-03
    • App components can be hosted anywhere ( on-premises or Cloud )
    • Authorized using JavaScript cross-domain library or OAuth
    • IncludesWindows Azure Web Sites
    • Can use ANY implementation language (ASP.NET, PHP, etc.)

    Auto-hosted Apps:

    apps-in-sharepoint-04
    • App components are hosted in SQL Azure and Windows Azure
    • Automatically provisioned when app is installed
    • Authorized using the JavaScript cross-domain library or OAuth
    • Only available in SharePoint Online
    • Infrastructure is in preview status
    • Production use not recommended
    • Office Store not yet accepted

    Host Web and App/Remote Web:

    apps-in-sharepoint-05
    • Each app is deployed to a SharePoint site known as the host web
    • Each app installation has its own unique URL
    • App web provisioned with app installation
      • https://[app prefix][app hash].[app domain]/[relative site URL]/[app name]
      • Required for Share Point hosted apps, optional for cloud-hosted apps
    • Cloud-hosted apps have a remote web
      • In Office 365, the remote web for Auto hosted apps is under 365apps.net
      • Name reminds us that this web doesn’t live on the SharePoint server

    App Development Tools:

    • Office development tools for Visual Studio 2012/2013
      apps-in-sharepoint-06
    • “Napa” Office 365 development tools
    • Browser-based development environment (SharePoint-hosted apps only)

    Office Development Tools for Visual Studio:

    apps-in-sharepoint-07
    apps-in-sharepoint-08
    • NET web application projects include classes to handle app AuthZ and AuthN (using OAuth)
    • SharePointContext.cs
      • Functions to manage SharePoint context across page requests
      • Can create app contexts and/or user for app and/or host webs
    • TokenHelper.cs
      • Functions to create and obtain AccessToken and ContextToken objects
    • On other platforms, you have to do the OAuth implementation and manage tokens yourself
    • Convert existing web application project to an App for SharePoint project
      apps-in-sharepoint-09

    Accessing SharePoint data remotely:

    • JavaScript client object model (JSOM)
    • .NET Managed client object model (CSOM)
    • REST endpoints with OData

    App authentication/authorization:

    • We can’t interact with data stored in SharePoint unless we (our apps) are authenticated to SharePoint and authorized to access data
      • Authentication: Are you who you say you are?
      • Authorization: Do you have permission to do what you are trying to do?
    • How can cloud-hosted apps for Share Point securely access data from the remote web?
      • Firewalls could be between servers
      • Code and script could be running on different domains
      • The external web server might not even be running Windows!

    App authorization policy types:

    • User-only
      • Only the user identity is considered (non-app interactions with Share Point)
    • App + User
      • “Access denied” if one and/or the other lacks permissions
      • Both the app identity and the user identity are considered
    • App-only
      • Only the app identity is considered
      • Only supported for server-side code in cloud-hosted apps
      • Can’t be used with certain APIs (e.g., Search, Project Server)
      • Allows for elevation above current user’s permissions (or when there is no current user)

    App permissions:

    • Trust must be explicitly granted by the user installing the app (nothing or all)
    • User installing the app must also have all permissions the app is requesting
      apps-in-sharepoint-10

    Deploying provider-hosted apps:

    • To use OAuth, you must register an app principal
      • Automatically handled for Auto-hosted apps and <F5> local host deployments
      • Requires a visit to /_layouts/15/AppRegNew.aspx for provider-hosted apps
        apps-in-sharepoint-11
    • Update <appSettings> values in web.config file
      <add key=”ClientId” value=”xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” /><add key=”ClientSecret” value=”xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=” />
    • Deploy/publish your remote web project
    • Set full URL for Start page in AppManifest.xml
      apps-in-sharepoint-12
    • Right-click and “Publish…” the app project
    • Click Package the app to generate .app file
      apps-in-sharepoint-13
    • Deploy the .app file to your app catalog
      apps-in-sharepoint-14
    • Click the link to launch the app
    • Grant permissions the app requests
      apps-in-sharepoint-10

    Difference between SharePoint 2010 Search and SharePoint 2013 Search

    $
    0
    0


     Search Features

    SharePoint 2010

    SharePoint 2013

    Installation
    Different Installation for SP2010 and FAST Search for SharePoint 2010
    Single installation in SharePoint 2013.
    Different offering for Search
    WSS Search, Microsoft Search Server, Search Server Express
    SharePoint Server Search  and SharePoint Foundation search.
    Crawling Components
    Multiple crawl components on a single server but each component was associated with only one crawl database. 
    Crawl components has been replaced by crawl roles in SP2013. ALL crawler roles talk to ALL crawl databases.  So whenever there is content to crawl, every crawl server in the farm can work on it.
    Host Distribution Rules
    In SP2010, you could pick certain crawl components to crawl a particular URL
    Host can be distributed across multiple crawl databases. The new distribution happens on the basis of Content DB Id rather than host URL.
    Content Processing Customization
    In SP2010 we had pipeline extensibility, which let you write custom code to use in the transformation of crawled content before it got added to the index. 
    In SharePoint 2013 the pipeline extensibility model is gone, but it has been replaced with a new web service callout feature.  It is invoked via triggers, which you create and are based on the value of different managed properties. 
    Security Information
    Search Admin DB was storing the security information (ACL information).
    Search Admin DB is not storing any ACL information now. It is storing with index itself in case of SP 2013.
    Built In BDC Connector
    No Documentum Connector or Term Store Connector
    New built-in Documentum Connector and Term Store Connectors are available in SP2013.
    HTTP Site Crawling
    Anonymous crawling was not supported into SP2010 for HTTP Site.
    Anonymous crawling is available in SP2013 for http sites.
    Crawling : Continuous Crawl
    <NA>
    New feature of Continuous Crawl is available in SP2013 only for SharePoint Sources. By default interval for this is “15” minutes, but can be changed through “Set-SPEnterpriseSearchCrawlContentSource” command.
    Result Sources
    Scopes and Federated Sources
    Scopes and Federated Sources in SP2010 are known as Result Sources in SharePoint 2013.
    Indexing : Remote SharePoint Source
    This functionality was not available in SP2010.
    A new feature to index “remote SharePoint Source” is available in SP2013 in which we can crawl a “remote SharePoint Source” available in remote SharePoint Farm in different geo locations using “oAuth Trust” which removes the issue of “kerbaros” authentication between he farms.
    Search  Sources
    In SP 2010, scopes can only be created by search service admin.
    Site and Site Collection admin can configure result sources for a site collection. There is no need of search service admin to intervene into this.
    Data  Source
    <NA>
    Exchange is now a data source for a “result source”
    Query Transformation for a Result Source
    <NA>
    Query Transformation can be applied for a result source in SP 2013.
    Indexing PDF Support
    Advanced Filter Pack/iFilter being used in SP2010
    Indexing PDF Support is OOB feature of SP2013.
    Format Handlers
    <NA>
    New Parsing feature in SP2013.
    Automatic file format detection: no longer relies on file extension
    Deep link extraction for Word and PowerPoint formats
    Visual metadata extraction: titles, authors and dates
    High-performance format handlers for HTML, DOCX, PPTX, TXT, Image, XML and PDF formats
    New  Filters for Visio and OneNote
    <NA>
    Available in SP2013 Search.
    Entity Extraction – Company
    Based on extraction dictionaries being managed in XML files on the file system
    Based on inclusion and exclusion dictionaries from within the term store of the Managed Metadata Service. In Addition, You can also do custom entity extraction in SharePoint 2013 using cmdlets and csv files as in FS4SP.
    Schema Management
    SSA Admin can only create “Crawled “ and “Managed” properties available to the entire farm.
    Capability to do limited schema management down to site collection admins. , site collection admins can create custom crawled and managed properties that are only used in their site collection!The managed properties that can be created are limited – meaning they cannot be refinable or sortable and it only supports a text data type. 
    Schema Management
    In SharePoint 2010, you had to do one full crawl of all your content to create a crawled property.  You could then create a managed property and map it to the crawled property, but you had to do a second full crawl of all your content to populate it with data.
    That is no longer required.  To begin with, when you create a new site column in SharePoint 2013, we automatically created a crawled property out of it right then and there – no other full crawl required.  Secondly, after you create a new managed property and map it to your crawled property, you NO LONGER NEED TO CRAWL THE ENTIRE FARM. Instead you can go into any list or library and there is an option now to Re-index the list. Alternatively you can go to the site level and choose to Re-index the Site
    Query Spelling Correction
    Default spelling dictionaries and the Query Spelling Inclusions list
    Customizations to Query Spelling Correction is now managed in the term store – both inclusions and exclusions. In addition to that we still have a dynamic dictionary that is based on content in the index itself, or you can also still choose to go with a static dictionary.
    Query Rules
    <NA>
    Query Rules allow you to have search requests from a user trigger multiple queries and multiple result sets. This differs from SharePoint 2010 where there were only simple queries – one query has one set of results.
    Result Types
    <NA>
    A result type consists primarily of a set of rules that describe which of the items in the search results match that result type. When a user issues a query, the results come back and each result is evaluated against the rules in the result types. SharePoint 2013 includes several predefined result types:
    Rich document results for PowerPoint, Word, and Excel documents
    Rich conversation results for Newsfeed posts, replies, and community discussions
    Rich video results and more…
    You can define your own Custom Result type.
    Display  Templates
    <NA>
    A display template is applied to the result based on the result type that it matches.
    You can define your own Custom Display Type.
    Faceted Navigation
    <NA>
    It uses a term from the term store to filter what kind of data should be displayed.
     
    §   With each term you select which managed properties should be used as refiners for that term
    §   Those managed properties must be configured as “Refinable”
    Example:
    ·          You have term store terms Camera and Laptop
     
    ·          You have managed properties Megapixel Count, Color and Manufacturer
     
    ·          For Camera term, you add refiners for Megapixel Count and Manufacturer
     
    ·          For Laptop term you add refiners for Color and Manufacturer
     
    Query Suggestions
    In SP2010, they are built based on user's performing searches and clicking through results
    In SP2013, it is based on :
    §   Your personal SharePoint activity factors into the query suggestions, i.e. you have a personal query log
     
    §   It includes weighting based on sites that you have previously visited
     
    §   It uses the most frequent queries across all users that “match” the search terms
     
    Note: You can also add inclusion and exclusion lists for suggestions via the search service application admin pages
     
    Query Suggestion Types
    <NA>
    There are two types of query suggestions – what you see when you are entering a query, and what you see when you get results
     
    When entering a query you will see two types of suggestions:
    ü  A list of items you have clicked on before from your personal query log
    ü  A list of items that others are typing for their queries
     
    When you get query results back, you will get another set of suggestions
    ü  They are a list of links that you have clicked through at least twice before and that match your search criteria
    Thumbnail Preview
    Thumbnail preview was available for Office documents with preview of first page in word doc and 3 slides in PPT.
    With new webapp engine, you can now browse through the entire document in the preview
    §   See all pages, see animations, zoom in, scroll through the entire document
    §   The point of this is to allow users to find the exact item they’re looking for right in search results – no more clicking a result, hitting the back button, and on and on until they find the one they’re looking for
     
    Previews only work with claims authentication – it will not work with classic Windows authentication.
     
    Search Portability
    <NA>
    Search Portability” supports transferring the following items:
    §   results sources
    §   query rules
    §   result types
    §   schema
    §   custom ranking models
    Transferring can happen between a tenant, site collection or site using import/export search configuration option of CSOM( Client side Object model).
     
    FAST Search Server 2010 Deprecated  Features in SharePoint 2013
    Feature Description
    Reason for Change
    Migration Path in SP2013
    DB Connector :The “FAST Search database”connector is not supported in SharePoint 2013
    The connector framework for SharePoint 2013 is combined with the BCS framework and the Business Data Catalog connectors.
    Replace the FAST Search database connector with the Business Data Catalog-based indexing connectors in the BCS framework.
    LotusNotes Connector: The “FAST Search Lotus Notes” connector is not supported in SharePoint 2013.
    The connector framework for SharePoint 2013 is combined with the BCS framework and the Business Data Catalog connectors.
    Replace the FAST Search Lotus Notes connector with the Lotus Notes indexing connector, or with a third-party connector.
    Web Crawler:The FAST Search web crawler is not supported in SharePoint 2013.
    The SharePoint 2013 crawler provides similar functionality to the FAST Search web crawler. The crawler capabilities are merged into one crawler implementation for consistency and ease of use.
    Use the standard SharePoint 2013 crawler.
    Find similar results: The Find similar results feature is not available in SharePoint 2013. The Find similar results feature is supported in FAST Search Server 2010 for SharePoint to search for results that resemble results that you have already retrieved.
    The Find similar results feature is available only within the query integration interfaces, and it does not consistently provide good results in many scenarios.
    As The Find similar results feature is not available in SharePoint 2013. There is no migration path available.
    Anti-phrasing:Anti-phrasing removes phrases that do not have to be indexed from queries, such as “who is”, “what is”, or “how do I”. These anti-phrases are listed in a static dictionary that the user cannot edit.
    The FAST Search Server 2010 for SharePoint feature has limited usage due to the limited number of customization options.
    Anti-phrasing is not supported in SharePoint 2013.
    None: In SharePoint 2013, such phrases are not removed from the query. Instead, all query terms are evaluated when you search the index.
    Offensive content filtering: In FAST Search Server 2010 for SharePoint, you can choose to filter offensive content. Offensive content filtering is not enabled by default.
    The feature has limited usage.
    None: The filtering of offensive content in search is deprecated in SharePoint 2013. In SharePoint 2013, you can no longer block documents that contain potentially offensive content from being indexed.
    Substring search: In FAST Search Server 2010 for SharePoint, substring search (N-gram indexing) can be used in addition to the statistical tokenizer in East Asian languages.
    The feature has limited usage, and has very extensive hard disk requirements for the index.
    None: The substring search feature was removed in SharePoint 2013.
    Person names and location extractions: In SharePoint 2013, you cannot extract person names and locations from documents by using predefined extractors.
    This feature has limited usage and usually requires extensive customization. In most cases, we recommend that you use customer-specific dictionaries.
    Use custom extractors for person names and locations. In SharePoint 2013, you can create custom extractors to extract person names and locations. The difference between the predefined extractors in FAST Search Server2010 for SharePoint, and custom extractors in SharePoint 2013, is that custom extractors are only based on dictionary entries, whereas the predefined extractors also use extraction rules.
    Number of custom entity extractors: In SharePoint 2013, the number of custom entity extractors that you can define is limited to 12.
    By using a predefined set of custom entity extractors, the content processing architecture is more simple and easier to use.
    Use the predefined set of custom entity extractors.
    In FAST Search Server 2010 for SharePoint Service Pack 1 (SP1), you can define an unlimited number of custom extractors. You can use custom entity extractors to populate refiners on the search result page.
    There are 12 predefined custom entity extractors in SharePoint 2013.
     
    Supported document formats: SharePoint 2013 no longer supports rarely used and older document formats that are supported in FAST Search Server 2010 for SharePoint by enabling the Advanced Filter Pack. Both the ULS logs and the crawl log indicate the items that were not crawled.
    The file formats for indexing are older formats and are no longer supported.
    In SharePoint 2013, the set of supported formats that are enabled by default is extended, and the quality of document parsing for these formats has improved.
     
    You can work with partners to create IFilter-based versions of the file formats that can no longer be indexed.
    Custom XML item processing:FAST Search Server 2010 for SharePoint includes a custom XML item processing feature as part of the content processing pipeline
    In SharePoint 2013, the content processing architecture has changed. Custom XML item processing was removed and we recommend that you implement a mapping functionality outside SharePoint.
    Custom XML item processing is not supported in SharePoint 2013.
    Custom XML item processing can be performed outside the content processing pipeline, for example by mapping XML content to a SharePoint list, or to a database table.
    Adding a test item to the index: DocPush is a test and diagnostic command-line tool that submits test documents to the FAST Search Server 2010 for SharePoint index. A similar command-line tool is not available in SharePoint 2013.
    The administration and diagnostics of feeding and crawling has changed in SharePoint 2013.
    None. No similar command-line tool is not available in SharePoint 2013.
    You can create test documents or test lists in SharePoint to test crawling and feeding. To remove items from the search index or to verify that there are any errors on an item, you can use the crawl log

    Search from Jquery

    $
    0
    0

    My Phonebook





    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    * {
      box-sizing: border-box;
    }

    #myInput {
      background-image: url('/css/searchicon.png');
      background-position: 10px 12px;
      background-repeat: no-repeat;
      width: 100%;
      font-size: 16px;
      padding: 12px 20px 12px 40px;
      border: 1px solid #ddd;
      margin-bottom: 12px;
    }

    #myUL {
      list-style-type: none;
      padding: 0;
      margin: 0;
    }

    #myUL li a {
      border: 1px solid #ddd;
      margin-top: -1px; /* Prevent double borders */
      background-color: #f6f6f6;
      padding: 12px;
      text-decoration: none;
      font-size: 18px;
      color: black;
      display: block
    }

    #myUL li a:hover:not(.header) {
      background-color: #eee;
    }
    </style>
    </head>
    <body>

    <h2>My Phonebook</h2>

    <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." title="Type in a name">

    <ul id="myUL">
      <li><a href="#">Adele</a></li>
      <li><a href="#">Agnes</a></li>

      <li><a href="#">Billy</a></li>
      <li><a href="#">Bob</a></li>

      <li><a href="#">Calvin</a></li>
      <li><a href="#">Christina</a></li>
      <li><a href="#">Cindy</a></li>
    </ul>

    <script>
    function myFunction() {
        var input, filter, ul, li, a, i;
        input = document.getElementById("myInput");
        filter = input.value.toUpperCase();
        ul = document.getElementById("myUL");
        li = ul.getElementsByTagName("li");
        for (i = 0; i < li.length; i++) {
            a = li[i].getElementsByTagName("a")[0];
            if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
                li[i].style.display = "";
            } else {
                li[i].style.display = "none";
            }
        }
    }
    </script>

    </body>
    </html>

    CSS3 Preloaders

    $
    0
    0
    Below you will find a range of pure CSS3 code preloaders. These preloaders can be used instead of animated gifs to let the end user know that content is being loaded. If you would like to add your preloader to this page, please contact me.
    To view code used, click on the preloader.
      


    Source Code for:

    <divclass="preloader1">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    </div>
    .preloader1 {
    width:40px;
    height:40px;
    display:inline-block;
    padding:0px;
    text-align:left;
    -webkit-animation:preloader1 1.4s linear infinite;
    animation:preloader1 1.4s linear infinite;
    }
    .preloader1 span {
    position:absolute;
    vertical-align:top;
    border-radius:100%;
    background:#000000;
    display:inline-block;
    width:8px;
    height:8px;
    margin-left:16px;
    transform-origin:center 20px;
    -webkit-transform-origin:center 20px;
    }
    .preloader1 span:nth-child(2){transform: rotate(36deg);-webkit-transform: rotate(36deg);opacity:0.1;}
    .preloader1 span:nth-child(3){transform: rotate(72deg);-webkit-transform: rotate(72deg);opacity:0.2;}
    .preloader1 span:nth-child(4){transform: rotate(108deg);-webkit-transform: rotate(108deg);opacity:0.3;}
    .preloader1 span:nth-child(5){transform: rotate(144deg);-webkit-transform: rotate(144deg);opacity:0.4;}
    .preloader1 span:nth-child(6){transform: rotate(180deg);-webkit-transform: rotate(180deg);opacity:0.5;}
    .preloader1 span:nth-child(7){transform: rotate(216deg);-webkit-transform: rotate(216deg);opacity:0.6;}
    .preloader1 span:nth-child(8){transform: rotate(252deg);-webkit-transform: rotate(252deg);opacity:0.7;}
    .preloader1 span:nth-child(9){transform: rotate(288deg);-webkit-transform: rotate(288deg);opacity:0.8;}
    .preloader1 span:nth-child(10){transform: rotate(324deg);-webkit-transform: rotate(324deg);opacity:0.9;}
    @keyframes preloader1 {
    from
    {transform: rotate(0deg);}
    to
    {transform: rotate(360deg);}
    }
    @-webkit-keyframes preloader1 {
    from
    {-webkit-transform: rotate(0deg);}
    to
    {-webkit-transform: rotate(360deg);}
    }

    Horizontal Line

    $
    0
    0



    <style type="text/css">
    .hr1 {
        border: 0;
        height: 1px;
        background: #333;
        background-image: linear-gradient(to right, #ccc, #333, #ccc);
    }

    /* Gradient transparent - color - transparent */

    .hr2 {
        border: 0;
        height: 1px;
        background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    }

    /* Double-color dashed line */

    .hr3 {
        border: 0;
        border-bottom: 4px dashed #ccc;
        background: #999;
    }

    /* Single-direction drop shadow */

    .hr4 {
        height: 12px;
        border: 0;
        box-shadow: inset 0 12px 12px -12px rgba(0, 0, 0, 0.5);
    }

    /* Cloud */

    .hr5 {
        border: 0;
        height: 0; /* Firefox... */
        box-shadow: 0 0 10px 1px black;
    }
    .hr5 {  /* Not really supposed to work, but does */
        content: "\00a0";  /* Prevent margin collapse */
    }

    /* Inset, by Dan Eden */

    .hr6 {
        border: 0;
        height: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* Flaired edges, by Tomas Theunissen */

    .hr7 {
        overflow: visible; /* For IE */
        height: 30px;
        border-style: solid;
        border-color: black;
        border-width: 1px 0 0 0;
        border-radius: 20px;
    }
    .hr7 { /* Not really supposed to work, but does */
        display: block;
        content: "";
        height: 30px;
        margin-top: -31px;
        border-style: solid;
        border-color: black;
        border-width: 0 0 1px 0;
        border-radius: 20px;
    }
    /* Glyph, by Harry Roberts */

    .hr8 {
        overflow: visible; /* For IE */
        padding: 0;
        border: none;
        border-top: medium double #333;
        color: #333;
        text-align: center;
    }
    .hr8:after {
        content: "§";
        display: inline-block;
        position: relative;
        top: -0.7em;
        font-size: 1.5em;
        padding: 0 0.25em;
        background: white;
    }

    </style>

    <hr class="hr1"></hr>
    <br><br>
    <hr class="hr2"></hr>
    <br><br>
    <hr class="hr3"></hr>
    <br><br>
    <hr class="hr4"></hr>
    <br><br>
    <hr class="hr5"></hr>
    <br><br>
    <hr class="hr6"></hr>
    <br><br>
    <hr class="hr7"></hr>
    <br><br>
    <hr class="hr8"></hr>

    What’s coming with SharePoint Server 2019

    $
    0
    0
    As Microsoft is on verge of announcing SharePoint Server 2019 on-premises, the team has completely focused on team collaboration, UI across devices, and how the cloud can be brought closer to existing on-premises capabilities with the new launch.
    Keeping that in mind, SharePoint Server 2019 will deliver new features in three important areas:
    1. Modern and attractive user experiences familiar to SharePoint Online
    2. Content engagement across all browsers and gadgets
    3. Powerful security and compliance policies
    SharePoint Server 2019 shall represent a whole new era in SharePoint. The goal is to bring user closer to the cloud and the cloud closer to user. As a result, we assume SharePoint Server 2019 will typically have “some of Office 365 features”.
    SharePoint Server 2019 on-premises version will be built on the strong foundational release of SharePoint Server 2016 and is a comprehensive solution for connected information work that preserves structured processes.
    With SharePoint Server 2019 Public Preview already being shipped mid-year 2018, potential users are curiously sparked with interest to know what the full version will bring with it.

    What to expect from SharePoint Server 2019

    SharePoint Server 2019 is expected to come bundled up with plethora of modern features already part of SharePoint Online.
    One of the big cons to SharePoint 2016 is that it does not have a lot (if any) of the modern SharePoint features. Fortunately, we will now have some (if not all) modern features brought in 2019 on-premises.
    Below, are new features and updates to existing features expected in SharePoint Server 2019 :

    Modern UI throughout the product

    The fact of the matter is how people interact with technology is much more than just "look and feel". Big Bets in SharePoint 2019 on-premises are listed below:
    • Communication sites (but no Hub sites): Which are a place to share news, showcase a story or broadcast a message to other people in a visually compelling format. Hub Sites, a feature that blends content from across communication and team sites, seems no longer a part of SharePoint Server 2019.
    • Modern team sites: Which enhances the rich and responsive user experience across teams. It is considered to be the most expected feature in SharePoint 2019, which the cloud users thrive upon.
    Sharepoint - Modern Team Sites
    Note: SharePoint Server 2019 shall continue to support creating classic team sites.
    • Modern site pages and Web parts: This enabling users to share ideas using pictures, Office documents, embed videos, and more. Users will now be able to create modern pages easily and by default, mobile-friendly. Most of the modern web parts will be there too.
    Sharepoint create modern pages
    • Modern lists and libraries: This providing individual and teams better ability to access, share, and collaborate around structured data and to bring information from other systems into SharePoint to leverage business processes. This brings in a similar experience to what found in SharePoint Online.
    Sharepoint- Modern List and Libraries
    • OneDrive for Business, making file storage and document collaboration more people-centric with new support for the latest generation of sync clients with it. The new SharePoint 2019 release surely brings in a lot of improvements with regard to usability, administration, and maintenance to hybrid architecture. Days have gone where OneDrive was lacking on-premises.
    • Modern sharing experiences, providing simplified sharing UI which allows users to share links to content with others in organization. The robust sharing experience found in Office 365 will now be a part of SharePoint 2019 on-premises.
    • Modern search experience, available through SharePoint home page, modern sites and libraries showing a compelling overview of search results easy to expand based on type, for example, people or sites.
    Sharepoint Search Results
    • Modern email sharing template, for sharing email notifications has been refreshed to use a modern template design.
    • Suite Navigation and App Launcher improvements, for Suite Navigation and App Launcher in SharePoint Server 2019 will now closely be aligned with what is familiar in Office 365.

    Platform Enhancements

    Along with new user experiences, there will be a few platform enhancements in SharePoint Server 2019:
    1. Fast site creation: SharePoint Server 2019 will allow users to create new sites in a few seconds.
    2. Large File Support: SharePoint Server 2019 will provide support for storing files up to 15 GB in SharePoint document libraries, which helps users to contribute modern media, large videos, audios and more. This will now increase from 10 GB found in SharePoint Server 2016.
    3. PDF Viewer: SharePoint Server 2019 will now allow rendering PDF documents on the server without a need to rely on a PDF viewer client application.
    4. SMTP Authentication: Users will now be able to use actual authenticated SMTP (including Office 365) to send out their emails.
    5. File/Folder Names: SharePoint Server 2019 will deliver support for a broad array of types and naming conventions to include # and % as supported characters in file and folder names across SharePoint document libraries. This will allow people to contribute and sync files containing # and % characters as prefix or suffix inside the file or folder name.
    6. Character Restrictions: SharePoint Server 2019 will increase the maximum file path length limit from 260 characters to 400 characters, making it easier to sync highly nested content to SharePoint.
    7. Recycle Bin restore improvements: Users with edit permissions can now restore items that they've removed themselves, and items that other users in the site have deleted.

    Business Process Improvements

    We know that customers worldwide use SharePoint to support collaboration, search, business process automation, and custom business applications; and we know that many customers rely on SharePoint Server for mission-critical workloads.
    Deeper PowerApps and Flow Integration: Microsoft has typically described PowerApps and Microsoft Flow as its successor products to InfoPath and SharePoint Designer. PowerApps are for developers, offering wizards and templates for creating Web and mobile apps, while Microsoft Flow is a service mashup tool for orchestrating workflows. Though, there still won’t be native PowerApps and Flow buttons and/or icons placed.

    Introduction of a Launching Point – SharePoint Home Page

    • SharePoint Server 2019 will introduce a one-stop UI enabling users with a unified access to all of their sites – online and on-premises.
    • It allows users to navigate seamlessly through their intranet, catch up with activity across their sites with just a glance, and provides a personalized view of all relevant team news in one place.
    • Users can now create new sites in a different web application, regardless of whether the web application is hosted on the local farm or a remote farm.

    Synching files becoming easier.

    Next-Gen OneDrive Sync Client: Users can use the new OneDrive sync client (NGSC – Next Generation Sync Client) instead of Groove.exe to sync files in your SharePoint Server 2019 team sites and personal sites with their devices, supporting advanced features such as Files On-Demand, push notification, and IRM protection while still being easy to use.
    Sharepoint server 2019

    Administration and/or Infrastructure Improvements

    Users who enjoy administration and infrastructure have not been left out. Improvements in those areas include:
    • Additional documentation links for Central Administration site: Users will now easily able to reach the latest SharePoint administration documentation and find the latest Public Updates.
    • Workflow manager 2019: SharePoint Workflows are not going anywhere in near future at least. Considering this, Microsoft will be releasing Workflow Manager 2019 to replace Workflow Manager 1.0. Things that can't be accomplished using Flow can be done using Workflow Manager.

    What can be excluded or deprecated from SharePoint Server 2019?

    SharePoint has always been focusing on collaboration, even when it is being principally used to build intranets.
    SharePoint 2019 will follow the same principle, with new features to help people to work together on files, lists, and libraries as well, providing a new generation of mobile and intelligent intranets.
    However, as we understand from release notes, Microsoft will surely opt to remove or deprecate some of the features which were the part of earlier versions:
    Access Services 2010 and 2013: With the advent of Microsoft PowerApps and Flows as potential alternatives, Access Services 2010 and 2013 will remain supported, but deprecated, for the SharePoint Server 2019 release.
    Aggregated Newsfeed: Microsoft highly recommends usage of options such as Team News, Communication Sites, Yammer and/or Teams while setting aggregated newsfeed feature to read-only in SharePoint Server 2019.
    Custom Help: The current help engine in SharePoint is expected to be removed in the future release.
    InfoPath will still be supported (but deprecated): InfoPath Services will remain supported, but deprecated, for the SharePoint Server 2019 release.
    Machine Translation (and Variations) and PerformancePoint Services: The Machine Translation and PerformancePoint Services will remain supported, but deprecated, for the SharePoint Server 2019 release. Microsoft recommends PowerBI as an alternative to PerformancePoint Services.
    SharePoint Designer: Microsoft has decided against introducing a new SharePoint Designer client with SharePoint Server 2019, while ensuring that SharePoint Designer 2013 will work with this release.
    Site Mailbox: Users are recommended to explore shared mailboxes as an alternative to site mailboxes.
    Site Manager: The primary functionality the Site Manager provides is now available in modern experience file move.
    Code-Based Sandbox Solutions: After careful consideration, Microsoft has decided to remove support for code-based sandbox solutions in SharePoint Server 2019. SharePoint add-ins are an alternative.
    The following features are not going to be available (possibly in future Updates):
    • Hub sites
    • Site Designs and Site Scripts
    • Site collection app catalog
    • Power BI web part
    Some of major features in Office 365 will not be supportive and will remain as cloud only capabilities:
    • Office 365 Groups
    • Planner
    • Microsoft Teams
    • Microsoft Forms 
    • Delve (though can be integrated with SharePoint 2019 in a hybrid scenario)
    • PowerBI (though can be integrated with SharePoint 2019 in a hybrid scenario)

    SharePoint Server 2016 v/s SharePoint Server 2019

    SharePoint Server 2019 will be updated to a modern experience first introduced in SharePoint Online. There will be a few differences between the modern experience in SharePoint Server 2019 and the classic experience of SharePoint Server 2016, which are detailed below.
    Modern experience
    The modern experience is part of several (but not all) features of SharePoint.
    The following experiences are modern by default:
    • SharePoint home page
    • Lists and libraries
    • Modern team site and communication site landing pages
    • New pages
    • Site contents
    • Site usage
    • Recycle Bin
    Classic experience still exist in existing team site pages and other site pages like wiki and web part pages.
    There is not a one-to-one correspondence of all classic to modern experiences.
    SharePoint home page
    • The SharePoint home page provides a modern experience where users can easily find and access frequent SharePoint sites within their organization.
    • Users also have the ability to find news from the sites they’re following and from other suggested sites.
    • Additionally, users having permission can create new sites from this page.
    Lists and libraries
    There is a significant amount of optimization in the default list and library experiences, where you can use the command bar to copy/move files and pin documents, and apply formatting to columns.
    Classic vs Modern Library
    Classic Library vs Modern Library
    There are some classic features that are different or not available in the modern view. These include some column types and some customizations.
    Team sites
    • Modern team sites are more collaborative than before.
    • They will come pre-populated with latest news, quick links, site activity, and documents.
    • As with all modern features, team sites are optimized to look great across mobile devices.
    Classic site vs Modern Site
    Classic Site vs Modern Site
    Below are few major differences between classic and modern team sites:
    • Home page: When you create a classic team site, web parts for Newsfeed, Calendar, and Links are added to the home page by default, while with a modern site, users will experience a section for News, Site activity, Quick links and Documents.
    • Branding: Using Company branding on SharePoint team sites is very common, and for classic sites we have used site themes, alternate CSS, and master pages. Although these elements are not supported on modern sites, there are other ways to perform site theming and branding.
    • Other differences include faster site creation, in-line editing of the top menu, and more.
    Communication sites
    • A communication site serves the same purpose as that to classic publishing sites, but there are many differences.
    • In general, communication sites are easier to create and don't need publishing site infrastructure.
    Differences between communication sites and publishing sites
    Communication SitesPublishing Sites
    A communication site is generally less structured.Publishing sites are typically more structured.
    A communication site does not need a master page.Publishing sites are built using a master page.
    It is designed to be used without sub-sites. It uses modern pages and web parts.As publishing portal is a site collection, it may also include sub sites.
    While there is less structure and enforcement on a communication site, it is easy to create an attractive, mobile-responsive page without code.Publishing sites require in-depth design and development to create customized master pages and page layouts.
    A communication site can be created with one of the predefined templates.Publishing sites are built using site publishing template.
    A communication site doesn’t need activation of publishing features.Publishing features must be activated in order to create a publishing site.
    • There is not a one-to-one correspondence between publishing sites and communication sites, and no automatic way to update publishing sites to communication sites.
    • Modern page functionality is not enabled, by default, on a SharePoint publishing portal.
    • Microsoft recommends you plan for and commence creating new communication sites as and when needed.
    Pages and web parts
    • Modern pages provide a fast, simpler way to build mobile-ready pages using modern web parts.
    • Pages are similar than classic web part pages and publishing pages, but are less structured and simpler to create.

    Classic Web Page vs Modern Web page
    Classic web page vs Modern web page
    Web parts: Modern pages employ modern web parts. Modern web parts are designed to be user-friendly, and they look attractive on the eye. Modern pages that use modern web parts does not need to deploy any code.
    Mobile responsive: Modern pages along with other modern features are designed to be mobile-friendly and look beautiful across mobile devices.
    Layout: When we create a classic page, we choose a layout with web part zones to use. The layout can't be changed without complexity. While with modern pages, the layout provides flexibility and can be changed at any moment of time.
    Wiki pages: Classic SharePoint provides another type of page – a Wiki page. There is no modern alternative for a Wiki page.
    Microsoft Flow
    • SharePoint workflows as well as Microsoft Flow, both will continue to be available in SharePoint Server 2019.
    • Though it will be easier to automate processes with Microsoft Flow.

    New Features In SharePoint 2019 Public Preview

    $
    0
    0
    Several new features have been added to the Public Preview of SharePoint 2019. Let us explore these below.
    Features
    1. Fast Site Creation for support with the following site templates: One Drive personal site, Team site (modern only), Communication site.
    2. Document library storage file size has been increased from 10 GB to 15 GB.
    3. SP 2019 Public Preview has modern experience for list and libraries in team sites. It is the same as we have in SP Online.
    4. Modern Search is supported in SP2019 PP, users can see results as they type.
    5. Access Service 2013 now supports SendEmail action for sending email messages from apps.
    6. PDF Documents can be rendered on the server and no longer need to rely on a PDF Viewer client application.
    7. SharePoint home page has a modern UI experience which is very similar to SP Online.
    8. Now, from SharePoint home, we can create a new site under different web applications using self-site creation.
    9. Self Service site creation on SharePoint home page now supports AAM zones.
    10. SP 2019 Public Preview now supports # and % characters in file and folders names.
    11. In Health Analyzer rules, People Picker health rule has been added.
    12. SMTP Authentication health rule also has been added to Health Analyzer.
    13. File path length limit  has increased from 260 to 400 characters.
    Deprecated Features in SharePoint 2019 Public Preview
    1. Access Service 2010 and 2013 are deprecated but will remain supported in SP 2019 Public Preview.
    2. InfoPath Services is also deprecated from SP 2019 Public Preview.
    3. Microsoft confirms that no new SP designer will be released and it will be supported until 2026
    Removed Features in SharePoint 2019 Public Preview
    1. Code-Sandbox solutions are removed, users need to explore SP add-ins as an alternative.
    2. Visio diagrams have 2 options: PNG based and Microsoft Silverlight based. Silverlight will not be supported as of Oct ober 12, 2021. Visio diagrams will be rendered using PNG based technology.
    Note
    Deprecated features are features which are no longer offered by Microsoft but they will continue to support them. These features can be removed in the future with no additional notice.
    The removedEdited feature is no longer supported by Microsoft in SharePoint Server 2019 Public Preview. In many cases, the feature is actually removed from the product.

    SharePoint 2010 Vs 2013 VS 2016 VS 2019 VS Office 365

    $
    0
    0

    SharePoint 2010

    Overall, this release built upon SharePoint 2007’s content management heritage–publishing framework, metadata, enterprise search–and was designed to further embed document collaboration into people’s everyday work.
    User ExperienceAdministration
    • Ribbon – Matching Office 2007 Release
    • Managed Metadata Service for true taxonomy
    • SharePoint Workspace for synchronization
    • Cross-browser and improved HTML support
    • Increases in thresholds & limits
    • Social features within a “My Site”
    • Office web applications
    • Improved central administration
    • Introduction of farm health analyzer
    • Better logging and usage reporting
    Unsure whether your organization should migrate to SharePoint 2019 or Office 365? Check out this post:CLICK TO TWEET

    SharePoint 2013

    SharePoint 2013 was a tale of two focuses. This is the year that Office 365 was truly born, and so while there were on-premises improvements, they were less pronounced than between 2007–2010.
    User ExperienceAdministration
    • FAST search embedded
    • Social newsfeed
    • Community template
    • eDiscovery
    • Apps for SharePoint
    • Share
    • Sync with OneDrive
    • Office Web Application Server
    • Hybrid support
    • PowerShell

    SharePoint 2016

    Truly “born from the cloud,” SharePoint 2016 was the first snapshot of technology taken from the refactored administration and user experience that was needed for Microsoft to be successful in the Cloud.
    User ExperienceAdministration
    • Durable links
    • OneDrive for Business
    • Durable links
    • Team site follow
    • Profile Redirection
    • Mobile
    • Hybrid app launcher
    • Thresholds & limits
    • Search
    • Scenario Picker
    • MinRole
    • Zero downtime patching
    • Fast site creation
    • Search improvements
    • Advanced hybrid features

    SharePoint 2019 and Office 365 Comparison: User Experience

    This is a current snapshot of the offerings of SharePoint 2019 and Office 365. While there will be improvements to SharePoint 2019 in the future, the one constant in Office 365 is change. The best way to stay in touch is to review the Microsoft 365 Roadmap, follow the Microsoft Tech Community, or attend one of the great SharePoint conferences throughout the year.
    SharePoint 2019Office 365
    • OneDrive (Next Generation Sync Client)
    • Modern
      • Sites – Team & Communication
      • Pages
      • Lists / Libraries
      • Hub Sites
      • SharePoint Home
    • Large file support
    • Extended character length
    • SharePoint Framework (SPFx)
    • OneDrive (Next Generation Sync Client)
    • Modern
      • Sites – Team & Communication
      • Pages
      • Lists / Libraries
      • Hub Sites
      • SharePoint Home
    • Large file support
    • Extended character length
    • SharePoint Framework (SPFx)
    • Microsoft Teams
    • Yammer
    • Power Apps & Flow
    • Delve
    • Stream
    • Planner

    SharePoint 2019 and Office 365 Comparison: Administration

    The benefits of administration are dependent on your context. On-premises gives you the ability to control every aspect of the service. However, the benefit requires focus time and actual infrastructure. In Office 365 you have less that you are able to control, but there are more advanced features that become available. Below is a listing of new features in SharePoint 2019 and an overview of Office 365; they’re a bit difficult to compare.
    SharePoint 2019Office 365
    • Newest IIS APIs
    • Newest Powershell
    • Updated health analyzer
    • Recycle bin restore improvements
    • Advanced hybrid scenarios
    • SharePoint & OneDrive Administrative Center
      • Sharing, storage, sync, device access
    • Security & Compliance Center
      • Classifications, data governance, threat management, reports

    SharePoint 2019 or Office 365

    We’ve reviewed the history of advancements within the evolution of SharePoint and lightly compared SharePoint 2019 and Office 365. If nothing else, you can see that the focus of Microsoft is aimed squarely at the cloud, with some of the best features being brought to the on-premises server. Ultimately, the decision of whether to move is not so dependent on features, but on the context of your decision.

    SharePoint 2019 vs SharePoint 2016 vs SharePoint Online. What’s the difference?

    $
    0
    0

    The latest version of SharePoint - Microsoft SharePoint 2019 - has been released. There are bound to be comparisons with previous versions of SharePoint, specifically 2016 version and SharePoint Online. Here we bring you a table of comparison that differentiates between SharePoint 2019, SharePoint 2016, and SharePoint Online. Get the best version of SharePoint based on your requirement
    Comparison of SharePoint versions

    SharePoint 2019
    SharePoint 2016
    SharePoint Online
    Storing files in document libraries  
    15 GB
    10 GB 
    NA 
    Maximum file path limit 
    400 characters 
    260 characters 
    260 characters 
    Send Email with Access Services 2013
    Yes 
    NA
    NA 
    Mobile Connectivity 
    Yes 
    Yes 
    Yes
    Additional documentation links for Central Administration site
    It is now easier for farm administrators to reach the latest SharePoint administration documentation and find the latest Public Updates by adding links in the SharePoint Central Administration homepage 
    Yes 
    No
    No 
    Access Services 2010 
    Deprecated
    Yes 
    Yes
    Access Services 2013
    Deprecated
    Yes 
    Yes
    Communication Sites 
    Yes 
    No
    No 
    Fast Site creation
    It helps the creation of new sites in a few seconds with specific templates
    Yes 
    No
    No 
    Modern list and sites in Team Sites 
    SharePoint Server 2019 contains the modern experiences for lists and libraries in Team sites
    Yes 
    No
    No 
    Simplified sharing user interface
    Warnings provided in case of sharing to a large group or sharing a large number of items
    Yes 
    NA
    NA 
    Modern Site Pages 
    Add modern site pages and modern web parts on team sites
    Yes 
    NA
    NA 
    Modern Team Sites 
    Team collaboration gets fresh and responsive user experience
    Yes 
    NA
    NA 
    Modern UI experience for SharePoint Homepage
    The redesigned homepage improves the discoverability of the most common collaboration tasks while putting your team’s news front and center
    Yes 
    NA
    NA 
    SMTP authentication support
    While sending emails, SharePoint 2019 supports authentication of SMTP servers 
    Yes 
    No
    No 
    Sync files with OneDrive sync client
    The new OneDrive sync client (NGSC – Next Generation Sync Client) instead of Groove.exe to sync files
    Yes 
    No
    No 
    Compliance feature - eDiscovery 
    Yes 
    Yes 
    Yes
    Service Application form
    Yes 
    Yes 
    No 
    Windows Powershell Support 
    Yes 
    Yes 
    Yes
    Distributed Cache
    Distributed Cache in SharePoint 2019 configures AppFabric Velocity Cache to use background garbage collection 
    Yes 
    Yes 
    No 
    Hybrid Improvements
    Yes 
    No
    No 
    Telemetry privacy experience
    Yes 
    No
    No 
    App Catalog (SharePoint)
    No
    Yes 
    Deprecated
    Content Search Web Part
    Yes 
    Yes 
    Yes
    Hybrid Search
    Yes 
    Yes 
    Yes
    Managed Navigation 
    Yes 
    Yes 
    Yes
    InfoPath Services
    Deprecated
    Yes 
    Yes
    SharePoint Designer
    Deprecated
    Yes 
    Yes
    Personal Site
    Yes 
    Yes 
    No 


    Export SharePoint Group Users Into Excel 2013 Using OData And REST API

    $
    0
    0
    We have export to excel functionality in SharePoint lists, but unfortunately this is not available in user information lists or SharePoint Groups. So we came up with a simple solution to export SharePoint Group users into excel using OData & REST. In this article, I explained how to achieve this.

    Prerequisites:
    1. SharePoint 2013 On-prem or O365 site, where you have sufficient permissions to perform REST query.
    2. MS Excel 2013, where you already signed-in with your domain account (for On-prem) or O365 account.

      MS Excel 2013
    Steps to export data from SharePoint to Excel
    1. Open Excel 2013.
    2. Go to ribbon, select DATA and select From Other Sources, and click on From OData Data Feed.

      From OData
    3. In ‘Data Connection Wizard’ form, provide appropriate REST link (see table above) and click on Next.

      REST Link format to get SPGroup users: 

      https://<Your SP2013 Site>/_api/Web/SiteGroups/getbyname('<Group Name')/Users

      SPGroup
    4. In Next form, select ‘Users’ table and click Next.

      Click Next
    5. In next form provide an appropriate data connection file name & friendly name (Note: this is not excel file name), check ‘Always attempt to use this file to refresh data’ and click Finish.

      connection
    6. In last form, ensure that ‘Table’ is selected. Select worksheet (by default its existing worksheet which is open) and click OK.

      Table
    7. Users of that group will be exported to the excel sheet.

      excel sheet
    Note: We can use same steps to get data from SharePoint lists into Excel with OData Data feed and REST API by providing a valid REST query in step #3.

    Crud Operation On SharePoint List Using SPFX No Framework WebPart

    $
    0
    0




    Creating SPFX web part

    The first step is to set up your dev environment for SharePoint framework development. if you have not already done so, follow this link to prepare environment Set up your SharePoint Framework development environment.
    Now that you have finished setting up your environment, follow the steps below to create anspfx web part:
    1. Open command line, cmd
    2. Create a folder using the command md, call it spfx (i.e. md NoFrameworkCrudWebPart)
    3. Navigate to the folder you just created using "cd NoFrameworkCrudWebPart" and type yo @microsoft/sharepoint 



    4. Follow the screenshot below to create a solution for your web part. Note that you can name your web part AzureWebAPIWebPart as shown below or anything you wish. Just ensure that when you are copying the code from here, you replace your web part name where necessary.  



    5. If all is well, you will seen a congratulations screen that looks like below. If there is any issue, ensure you fix it before going on to the next step.


    6. You can run gulp serve to ensure everything is okay. This should launch your default browser. Click the plus sign and add your web part. If all is fine, you should see your web part with default look.
     Now let's install jquery and Typings for jquery as we require jqueryajax to make calls to our web API.
    7. To add jquery to your project, on command line type:
         npmjquery --save
         npm @types/jquery --save
    8. Then type "code ." without the quote to open visual studio code editor.
    9. Click the drop down arrow next to src>Webparts>YourWebpartName 
    10. Verify that jquery library was added successfully to your project by clicking the arrow next to nodes_modules>jquery> dist. Verify jquery.min.js is there.
    Let's un-bundle the jquery library by externalizing it. This step is optional but good for page load performance.
    11. Open Config.jsonYourWebpartName>Config>Config.json
    12. Modify it as shown below

    "externals": {
        "jquery": {
          "path": "node_modules/jquery/dist/jquery.min.js",
          "globalName": "jQuery"
        }
    13. Go back to src and open YourWebpartName.ts. Let's import the jquery and load css file from a SharePoint library in the YourWebpartName.ts.



    NoFrameworkCrudWebPart.ts
    import{ Version } from'@microsoft/sp-core-library'; 
    import{ 
    BaseClientSideWebPart, 
    IPropertyPaneConfiguration, 
    PropertyPaneTextField
    } from'@microsoft/sp-webpart-base'; 
    import{ escape } from'@microsoft/sp-lodash-subset'; 

    import{ SPHttpClient, SPHttpClientResponse } from'@microsoft/sp-http'; 
    import{ IListItem } from'./IListItem'; 
    import{ SPComponentLoader } from'@microsoft/sp-loader';
    importstyles from'./NoFrameworkCrudWebPart.module.scss'; 
    import*asstrings from'NoFrameworkCrudWebPartStrings'; 
    SPComponentLoader.loadCss('https://omniee.sharepoint.com/sites/NGO/SiteAssets/styles.css');

    exportinterfaceINoFrameworkCrudWebPartProps { 
    listName: string; 
    } 
    /*<div class="ms-Grid-row ms-bgColor-themeDarkms-fontColor-white ${styles.row}">

    </div>

    <div class="ms-Grid-row ms-bgColor-themeDarkms-fontColor-white ${styles.row}">
    <div class="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
    <div class="status"></div>
    <ul class="items"><ul>
    </div>
    </div><p class="${ styles.subTitle }">No Framework</p>
    <p class="${ styles.description }">Name: ${this.Listname}</p>  */
    exportdefaultclassNoFrameworkCrudWebPartextendsBaseClientSideWebPart<INoFrameworkCrudWebPartProps> { 
    privatelistItemEntityTypeName: string = undefined; 
    privateListname :string="Students";
    /* <button  style="display: none" class="${styles.button} read-Button">
    <span  class="${styles.label}">Read item</span>
    </button>

    <button style="display: none" class="${styles.button} delete-Button">
    <span class="${styles.label}">Delete item</span>
    </button> */
    publicrender(): void { 
    this.domElement.innerHTML = ` 
    <div class="${styles.noFrameworkCrud}">
    <div class="${styles.container}">
    <div class="${styles.row}">
    <div class="${styles.column}">
    <span class="${styles.title}"></span>

    <div class="row">
    <h2 style="text-align:left" id="statusMode">
                  CRUD Operation From SharePoint List Using NoFramework SPFX Online 
    </h4>
    <div class="row">
    <div class="col-25">
    <label for="fname">Title</label>
    </div>
    <div class="col-75">
    <input type="text" id="idTitle" name="Title" placeholder="Title.">
    </div>
    </div>
    <div class="row">
    <div class="col-25">
    <label for="fname">Name</label>
    </div>
    <div class="col-75">
    <input type="text" id="idfname" name="firstname" placeholder="Name.">
    </div>
    </div>
    <div class="row">
    <div class="col-25">
    <label for="lname">Gender</label>
    </div>
    <div class="col-75">
    <input type="text" id="idgender" name="gender" placeholder="Gender..">
    </div>
    </div>
    <div class="row">
    <div class="col-25">
    <label for="country">Department</label>
    </div>
    <div class="col-75">
    <input type="text" id="idDepart" name="lname" placeholder="Department..">
    </div>
    </div>
    <div class="row">
    <div class="col-25">
    <label for="subject">City</label>
    </div>
    <div class="col-75">
    <input type="text" id="idCity" name="gender" placeholder="City..">
    </div>
    </div>
    <!-- hidden controls -->
    <div style="display: none">
    <input id="recordId" />
    </div>
    <div class="row">
    <div class="ms-Grid-row ms-bgColor-themeDarkms-fontColor-white ${styles.row}">

    <div  style="margin-left: 66px" class="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">
    <button class="${styles.button} create-Button">
    <span class="${styles.label}">Save</span>
    </button>
    <button class="${styles.button} update-Button">
    <span class="${styles.label}">Update</span>
    </button>
    <button  class="${styles.button} read-Button">
    <span  class="${styles.label}">Clear All</span>
    </button>
    </div>
    </div>
    </div>
    <div class="divTableblueTable">
    <div class="divTableHeading">
    <div class="divTableRow">
    <div class="divTableHead">Title</div>
    <div class="divTableHead">Name</div>
    <div class="divTableHead">Gender</div>
    <div class="divTableHead">Department</div>
    <div class="divTableHead">City</div>
    </div>
    </div>
    <div class="divTableBody" id="fileGrid">
    </div>
    </div>
    <div class="blueTableouterTableFooter"><div class="tableFootStyle"><div class="links"><a href="#">&laquo;</a><a class="active" href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">4</a><a href="#">&raquo;</a></div></div></div>
    </div>
    </div>
    </div>
    </div>`; 
    this.setButtonsEventHandlers();
    this.getAllItem();
      } 

    privatesetButtonsEventHandlers(): void { 
    constwebPart: NoFrameworkCrudWebPart = this; 
    this.domElement.querySelector('button.create-Button').addEventListener('click', () =>{ webPart.SaveItem(); }); 
    this.domElement.querySelector('button.update-Button').addEventListener('click', () =>{ webPart.updateItem(); }); 
    this.domElement.querySelector('button.read-Button').addEventListener('click', () =>{ webPart.ClearMethod(); }); 
      }
    // Start Get All Data From SharePoint  List
    privategetAllItem(){ 
    this.context.spHttpClient.get(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.Listname}')/items?$orderby=Created desc`, 
               SPHttpClient.configurations.v1, 
               { 
    headers: { 
    'Accept': 'application/json;odata=nometadata', 
    'odata-version': ''
                 } 
               })
               .then((response: SPHttpClientResponse)=> { 
    returnresponse.json(); 
               }) 
               .then((item):void => {
    debugger;
    varlen = item.value.length
    vartxt = "";
    if(len>0){
    for(vari=0;i<len;i++){

    txt += '<div class="divTableRow"><div class="divTableCell">'+item.value[i].Title +'</div><div class="divTableCell">'+item.value[i].NameF +'</div><div class="divTableCell">'+item.value[i].Gender+'</div>' +
    '<div class="divTableCell">'+item.value[i].Department+'</div><div class="divTableCell">'+item.value[i].City+'</div><div class="divTableCell">'+"<a id='"+ item.value[i].ID + "' href='#' class='EditFileLink'>Edit</a>"+'</div><div class="divTableCell">'+"<a id='"+ item.value[i].ID + "' href='#' class='DeleteLink'>Delete</a>"+'</div></div>';
                     }
    if(txt != ""){
    document.getElementById("fileGrid").innerHTML = txt;
                      }

    //  delete Start Bind The Event into anchor Tag
    letlistItems = document.getElementsByClassName("DeleteLink")
    for(let j:number = 0; j<listItems.length; j++){
    listItems[j].addEventListener('click', (event) =>{
    this.DeleteItemClicked(event);
                        });
                      }
    // End Bind The Event into anchor Tag

    //  Edit Start Bind The Event into anchor Tag
    letEditlistItems = document.getElementsByClassName("EditFileLink")
    for(let j:number = 0; j<EditlistItems.length; j++){
    EditlistItems[j].addEventListener('click', (event) =>{
    this.UpdateItemClicked(event);
                          });
                        }
    // End Bind The Event into anchor Tag
                 }
    // debugger;

    //console.log(item.Title) ;

               }, (error: any): void => { 
    alert(error);
               }); 
          }
    // End Get All Data From SharePoint  List
    //Start Save Item in SharerPoint List
    privateSaveItem(): void { 
    debugger;
    if(document.getElementById('idTitle')["value"]=="")
        {
    alert('Required the Title !!!')
    return;
        }
    if(document.getElementById('idfname')["value"]=="")
        {
    alert('Required the Name !!!')
    return;
        }
    if(document.getElementById('idgender')["value"]=="")
        {
    alert('Required the Gender !!!')
    return;
        }
    if(document.getElementById('idDepart')["value"]=="")
        {
    alert('Required the Department !!!')
    return;
        }
    if(document.getElementById('idCity')["value"]=="")
        {
    alert('Required the City !!!')
    return;
        }
    constbody: string = JSON.stringify({ 
    'Title': document.getElementById('idTitle')["value"],
    'NameF': document.getElementById('idfname')["value"],
    'Gender': document.getElementById('idgender')["value"],
    'Department': document.getElementById('idDepart')["value"],
    'City': document.getElementById('idCity')["value"]    
        });  
    this.context.spHttpClient.post(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.Listname}')/items`, 
        SPHttpClient.configurations.v1, 
        { 
    headers: { 
    'Accept': 'application/json;odata=nometadata', 
    'Content-type': 'application/json;odata=nometadata', 
    'odata-version': ''
          }, 
    body: body 
        }) 
        .then((response: SPHttpClientResponse): Promise<IListItem>=> { 
    returnresponse.json(); 
        }) 
        .then((item: IListItem): void => {
    this.ClearMethod();
    alert('Item has been successfully Saved ');
    localStorage.removeItem('ItemId');
    localStorage.clear();
    this.getAllItem();
        }, (error: any): void => { 
    alert(`${error}`); 
        }); 
      } 
    //End Save Item in SharerPoint List

    //Start Update Item in SharerPoint List
    privateUpdateItemClicked(ev): void{
    letme:any = ev.target;
    this.getByIdItem(me.id);
      }
    privateupdateItem(){
    ///alert(localStorage.getItem('ItemId')) ;
    constbody: string = JSON.stringify({ 
    'Title': document.getElementById('idTitle')["value"],
    'NameF': document.getElementById('idfname')["value"],
    'Gender': document.getElementById('idgender')["value"],
    'Department': document.getElementById('idDepart')["value"],
    'City': document.getElementById('idCity')["value"]    
        });  
    this.context.spHttpClient.post(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.Listname}')/items(${localStorage.getItem('ItemId')})`, 
              SPHttpClient.configurations.v1, 
              { 
    headers: { 
    'Accept': 'application/json;odata=nometadata', 
    'Content-type': 'application/json;odata=nometadata', 
    'odata-version': '', 
    'IF-MATCH': '*', 
    'X-HTTP-Method': 'MERGE'
                }, 
    body: body
              }) 
              .then((response: SPHttpClientResponse): void => { 
    alert(`Item with ID: ${localStorage.getItem('ItemId')} successfully updated`);
    this.ClearMethod()
    localStorage.removeItem('ItemId');
    localStorage.clear();
    this.getAllItem();

              }, (error: any): void => { 
    alert(`${error}`); 
              }); 

      } 
    //End Update Item in SharerPoint List
    // Delete the Items From SharePoint List
    privateDeleteItemClicked(ev): void{
    letme:any = ev.target;
    //alert(me.id);
    this.deleteItem(me.id);
      }
    privatedeleteItem(Id: number){
    if(!window.confirm('Are you sure you want to delete the latest item?')) { 
    return; 
        } 
    letetag: string = undefined; 
    this.context.spHttpClient.post(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.Listname}')/items(${Id})`, 
              SPHttpClient.configurations.v1, 
              { 
    headers: { 
    'Accept': 'application/json;odata=nometadata', 
    'Content-type': 'application/json;odata=verbose', 
    'odata-version': '', 
    'IF-MATCH': '*', 
    'X-HTTP-Method': 'DELETE'
                } 
              })
          .then((response: SPHttpClientResponse): void => { 
    alert(`Item with ID: ${Id} successfully Deleted`)

    this.getAllItem();
          }, (error: any): void => { 
    alert(`${error}`); 
          }); 
      } 
    // End Delete the Items From SharePoint List

    // Start Get Item By Id
    privategetByIdItem(Id: number){ 
    this.context.spHttpClient.get(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.Listname}')/items(${Id})`, 
         SPHttpClient.configurations.v1, 
         { 
    headers: { 
    'Accept': 'application/json;odata=nometadata', 
    'odata-version': ''
           } 
         })
         .then((response: SPHttpClientResponse)=> { 
    returnresponse.json(); 
         }) 
         .then((item):void => {
    document.getElementById('idTitle')["value"]=item.Title;
    document.getElementById('idfname')["value"]=item.NameF;
    document.getElementById('idgender')["value"]=item.Gender;
    document.getElementById('idDepart')["value"]=item.Department;
    document.getElementById('idCity')["value"]=item.City;
    localStorage.setItem('ItemId', item.Id);

         }, (error: any): void => { 
    alert(error);
         }); 
    }
    // End Get Item By Id
    // start Clear Method of input type
    privateClearMethod()
    {
    document.getElementById('idTitle')["value"]="";
    document.getElementById('idfname')["value"]="";
    document.getElementById('idgender')["value"]="";
    document.getElementById('idDepart')["value"]="";
    document.getElementById('idCity')["value"]="";
    }
    // End Clear Method of input type
    protectedgetPropertyPaneConfiguration(): IPropertyPaneConfiguration { 
    return{ 
    pages: [ 
            { 
    header: { 
    description: strings.PropertyPaneDescription
              }, 
    groups: [ 
                { 
    groupName: strings.BasicGroupName, 
    groupFields: [ 
    PropertyPaneTextField('listname', { 
    label: strings.ListNameFieldLabel
                    }) 
                  ] 
                } 
              ] 
            } 
          ] 
        }; 
      } 
    }



    NoFrameworkCrudWebPart.module.scss
    @import'~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';

    .noFrameworkCrud {
    .container{
    max-width: 700px;
    margin: 0pxauto;
    box-shadow: 02px4px0rgba(0, 0, 0, 0.2), 025px50px0rgba(0, 0, 0, 0.1);
      }

    .row{
    @includems-Grid-row;
    @includems-fontColor-white;
    background-color: $ms-color-themeDark;
    padding: 20px;
      }

    .column{
    @includems-Grid-col;
    @includems-lg10;
    @includems-xl8;
    @includems-xlPush2;
    @includems-lgPush1;
      }

    .title{
    @includems-font-xl;
    @includems-fontColor-white;
      }

    .subTitle{
    @includems-font-l;
    @includems-fontColor-white;
      }

    .description{
    @includems-font-l;
    @includems-fontColor-white;
      }

    .button{
    // Our button
    text-decoration: none;
    height: 32px;

    // Primary Button
    min-width: 80px;
    background-color: $ms-color-themePrimary;
    border-color: $ms-color-themePrimary;
    color: $ms-color-white;

    // Basic Button
    outline: transparent;
    position: relative;
    font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: $ms-font-size-m;
    font-weight: $ms-font-weight-regular;
    border-width: 0;
    text-align: center;
    cursor: pointer;
    display: inline-block;
    padding: 016px;

    .label{
    font-weight: $ms-font-weight-semibold;
    font-size: $ms-font-size-m;
    height: 32px;
    line-height: 32px;
    margin: 04px;
    vertical-align: top;
    display: inline-block;
        }
      }
    }

    NoFrameworkCrudWebPart.manifest.json
    {
    "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
    "id": "5eb68e1e-2fb9-4020-9cc5-ad8e832a6dcc",
    "alias": "NoFrameworkCrudWebPart",
    "componentType": "WebPart",

    // The "*" signifies that the version should be taken from the package.json
    "version": "*",
    "manifestVersion": 2,

    // If true, the component can only be installed on sites where Custom Script is allowed.
    // Components that allow authors to embed arbitrary script code should set this to true.
    // https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
    "requiresCustomScript": false,

    "preconfiguredEntries": [{
    "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other
    "group": { "default": "Other" },
    "title": { "default": "noFrameworkCrud" },
    "description": { "default": "noFrameworkCrud" },
    "officeFabricIconFontName": "Page",
    "properties": {
    "description": "noFrameworkCrud"
        }
      }]
    }

    IListItem.ts
    exportinterfaceIListItem { 
        Title?: string; 
        Id: number; 
    }

    In loc Folder Check belw JS and TS File
    en-us.js
    define([], function() { 
    return{ 
    "PropertyPaneDescription": "Description", 
    "BasicGroupName": "Group Name", 
    "ListNameFieldLabel": "List Name"
      } 
    });
    mystrings.d.ts
    declareinterfaceINoFrameworkCrudWebPartStrings { 
    PropertyPaneDescription: string; 
    BasicGroupName: string; 
    ListNameFieldLabel: string; 
    } 
    declaremodule'NoFrameworkCrudWebPartStrings' { 
    conststrings: INoFrameworkCrudWebPartStrings; 
    export= strings; 
    } 

     Copy and paste the css file below in notepad and save as styles.css Put SharePoint On Line Site Site Assets

    div.blueTable {
      border: 1px solid #1C6EA4;
      background-color: #EEEEEE;
      width: 100%;
      text-align: left;
      border-collapse: collapse;
    }
    .divTable.blueTable .divTableCell, .divTable.blueTable .divTableHead {
      border: 1px solid #AAAAAA;
      padding: 3px 2px;
    }
    .divTable.blueTable .divTableBody .divTableCell {
      font-size: 13px;
    }
    .divTable.blueTable .divTableRow:nth-child(even) {
      background: #D0E4F5;
    }
    .divTable.blueTable .divTableHeading {
      background: #1C6EA4;
    background: -moz-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
    background: -webkit-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
    background: linear-gradient(to bottom, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
      border-bottom: 2px solid #444444;
    }
    .divTable.blueTable .divTableHeading .divTableHead {
      font-size: 15px;
      font-weight: bold;
    color: #FFFFFF;
      border-left: 2px solid #D0E4F5;
    }
    .divTable.blueTable .divTableHeading .divTableHead:first-child {
      border-left: none;
    }

    .blueTable .tableFootStyle {
      font-size: 14px;
      font-weight: bold;
    color: #FFFFFF;
      background: #D0E4F5;
    background: -moz-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
    background: -webkit-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
    background: linear-gradient(to bottom, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
      border-top: 2px solid #444444;
    }
    .blueTable .tableFootStyle {
      font-size: 14px;
    }
    .blueTable .tableFootStyle .links {
            text-align: right;
    }
    .blueTable .tableFootStyle .links a{
      display: inline-block;
      background: #1C6EA4;
    color: #FFFFFF;
      padding: 2px 8px;
      border-radius: 5px;
    }
    .blueTable.outerTableFooter {
      border-top: none;
    }
    .blueTable.outerTableFooter .tableFootStyle {
      padding: 3px 5px;
    }
    /* DivTable.com */
    .divTable{ display: table; }
    .divTableRow { display: table-row; }
    .divTableHeading { display: table-header-group;}
    .divTableCell, .divTableHead { display: table-cell;}
    .divTableHeading { display: table-header-group;}
    .divTableFoot { display: table-footer-group;}
    .divTableBody { display: table-row-group;}


    /* Css styles for the form */

    * {
        box-sizing: border-box;
    }

    input[type=text], select, textarea{
        width: 100%;
        padding: 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
        resize: vertical;
    }

    label {
        padding: 12px 12px12px 0;
        display: inline-block;
    }

    input[type=submit] {
        background-color: #4CAF50;
    color: white;
        padding: 12px 20px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        float: right;
    }

    input[type=submit]:hover {
        background-color: #45a049;
    }

    .container {
        border-radius: 5px;
        background-color: #f2f2f2;
        padding: 20px;
    }

    .col-25 {
        float: left;
        width: 25%;
        margin-top: 6px;
    }

    .col-75 {
        float: left;
        width: 75%;
        margin-top: 6px;
    }

    /* Clear floats after the columns */
    .row:after {
        content: "";
        display: table;
        clear: both;
    }

    /* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
    @media (max-width: 600px) {
        .col-25, .col-75, input[type=submit] {
            width: 100%;
            margin-top: 0;
        }
    }

    Reference Below:



    Using SPFX File uploaded in SharePoint document Library using Grid Data table

    $
    0
    0








    Using SPFX File uploaded in SharePoint document Library using Grid Data table
    1-      Display Page


    2- Add Page


    2-   Edit Page

    4-Delete Page

    5- Library Name : column –Phone,FileDescription,Company

    6- Create One Web part Name: Spfxseparatfile

    1-SpfxseparatfileWebPart.module.scss
    @import'~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';

    .spfxseparatfile {
    .container{
    max-width: 700px;
    margin: 0pxauto;
    box-shadow: 02px4px0rgba(0, 0, 0, 0.2), 025px50px0rgba(0, 0, 0, 0.1);
      }

    .row{
    @includems-Grid-row;
    @includems-fontColor-white;
    background-color: $ms-color-themeDark;
    padding: 20px;
      }

    .column{
    @includems-Grid-col;
    @includems-lg10;
    @includems-xl8;
    @includems-xlPush2;
    @includems-lgPush1;
      }

    .title{
    @includems-font-xl;
    @includems-fontColor-white;
      }

    .subTitle{
    @includems-font-l;
    @includems-fontColor-white;
      }

    .description{
    @includems-font-l;
    @includems-fontColor-white;
      }

    .button{
    // Our button
    text-decoration: none;
    height: 32px;

    // Primary Button
    min-width: 80px;
    background-color: $ms-color-themePrimary;
    border-color: $ms-color-themePrimary;
    color: $ms-color-white;

    // Basic Button
    outline: transparent;
    position: relative;
    font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: $ms-font-size-m;
    font-weight: $ms-font-weight-regular;
    border-width: 0;
    text-align: center;
    cursor: pointer;
    display: inline-block;
    padding: 016px;

    .label {
    font-weight: $ms-font-weight-semibold;
    font-size: $ms-font-size-m;
    height: 32px;
    line-height: 32px;
    margin: 04px;
    vertical-align: top;
    display: inline-block;
        }
      }
    }

    2-SpfxseparatfileWebPart.ts

    import{ Version } from'@microsoft/sp-core-library';
    import{ BaseClientSideWebPart } from'@microsoft/sp-webpart-base';
    import{
    IPropertyPaneConfiguration,
    PropertyPaneTextField
    } from'@microsoft/sp-property-pane';
    import{ escape } from'@microsoft/sp-lodash-subset';

    import{ SPComponentLoader } from'@microsoft/sp-loader';
    importstyles from'./SpfxseparatfileWebPart.module.scss';
    import*asstrings from'SpfxseparatfileWebPartStrings';
    import*as$ from'jquery';

    import*astoastrfrom'toastr';
    import{ registerBeforeUnloadHandler } from'@microsoft/teams-js';

    // Load JS and Css or external url in Page  if you want global declareation then used config file .

    //1- Using Config
    //1- its define in configJs after that used here
    //require('tether');
    //require('bootstrap');
    //require('datatables.select');


    //2- Its direct load From node_modules.
    // require('../../../node_modules/bootstrap/dist/js/bootstrap.min.js');
    require('../../../node_modules/datatables.net/js/jquery.dataTables.min.js');



    //2- Usig By SPComponentLoader  Class
    //  LaodCss File
    SPComponentLoader.loadCss('https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/css/tether.min.css');
    SPComponentLoader.loadCss('https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css');
    SPComponentLoader.loadCss('https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css');
    SPComponentLoader.loadCss('https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css');

    // load Js File
    SPComponentLoader.loadScript('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js');
    //SPComponentLoader.loadScript('https://cdn.rawgit.com/rainabba/jquery-table2excel/1.1.0/dist/jquery.table2excel.min.js');
    //SPComponentLoader.loadScript('https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/js/jquery.dataTables.min.js');


    exportinterfaceISpfxseparatfileWebPartProps {
    description: string;
    }

    exportdefaultclassSpfxseparatfileWebPartextendsBaseClientSideWebPart<ISpfxseparatfileWebPartProps> {

    publicrender(): void {
    this.domElement.innerHTML = `

    <div class="container" style="overflow-x:auto;">

    <h2><span class="label label-primary">Using SPFX File uploaded in sharepoint document Library Grid Datatable</span></h2><br>

    <div id="toolbar">
    <button type="button" value="Files" class="btnbtn-info" onclick="Javascript: location.href = 'https://mulltiverse.sharepoint.com/Lists/NGODoc'"><span class='glyphiconglyphicon-upload'></span> File List</button>
    <button type="button" class="btnbtn-success addNewFile"><span class='glyphiconglyphicon-plus'></span> Add New File</button>
    <button type="button" class="btnbtn-danger addexportToExcel"><span class='glyphiconglyphicon-plus'></span> Export to excel</button>
    </div>
    <p></p>

    <div id="FilesPanel">
    <table style="width: 80%">
    <tr>
    <td>
    <div id="FilesGrid" style="width: 80% "></div>
    </td>
    </tr>
    </table>
    </div>

    <!-- Bootstrap Modal Dialog for new/edit files-->
    <div class="modal fade" id="myModalNorm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
    <div class="modal-content">
    <!-- Modal Header -->
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">
    <span aria-hidden="true">&times;</span>
    <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title" id="myModalLabel">
                        Add New File
    </h4>
    </div>
    <!-- Modal Body -->
    <div class="modal-body" id="modalBody">
    <form role="form" id="fileForm">
    <div class="form-group">
    <label>File Title</label>
    <input style="width:250px;" id="uploadFile" type="file" name="inputfile"/>
    </div>
    <div class="form-group">
    <label>File Company</label>
    <input class="form-control" id="fileCompany"/>
    </div>
    <div class="form-group">
    <label>File Description</label>
    <input class="form-control" id="fileDescription"/>
    </div>
    <div class="form-group">
    <label>Phone</label>
    <input class="form-control" id="filePhone"/>
    </div>
    <!-- hidden controls -->
    <div style="display: none">
    <input id="etag" />
    <input id="fileId" />
    </div>
    </form>
    <div class="modal-footer">
    <button type="button" class="btnbtn-danger" data-dismiss="modal" onclick='updateFormLabel();'>
                            Cancel
    </button>
    <button type="submit" class="btnbtn-primary" id="fileFormSubmit">
                            Submit/Upload
    </button>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <!-- Bootstrap Modal Dialog for delete files-->
    <div class="modal fade" id="deleteFiles" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
    <div class="modal-content">
    <!-- Modal Header -->
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">
    <span aria-hidden="true">&times;</span>
    <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title" id="myModalLabel2">
                        Delete Confirmation
    </h4>
    </div>
    <!-- Modal Body -->
    <div class="modal-body" id="modalBody2">
    <p>Are you sure you wish to delete this item?</p>
    <form role="form" id="deleteForm">
    <!-- hidden controls -->
    <div style="display: none">
    <input id="deleteId" />
    </div>
    </form>
    <div class="modal-footer">
    <button type="button" class="btnbtn-danger" data-dismiss="modal"'>
                            Cancel
    </button>
    <button type="submit" class="btnbtn-primary" id="deleteConfirmationSubmit">
                            Submit
    </button>
    </div>
    </div>
    </div>
    </div>`; 

    varabsuluteUrl=this.context.pageContext.web.absoluteUrl;

    varRestUrl = absuluteUrl+ "/_api/lists/getbytitle('NGODoc')/items?$expand=Folder&$select=id,Title,Company,FileDescription,Phone,EncodedAbsUrl,FileRef,FSObjType,FileLeafRef,Folder/ServerRelativeUrl&$top=500";
            $(document).ready(function () {
    PopulateGrid();
            $('#fileFormSubmit').click(function (e) {
    debugger;

    //Check for edit or new and call update or add function
    if($('#myModalLabel').html() == 'Add New File') {
    addFile();
                } else {
    UpdateFiles($('#fileId').val());
                }
            });

    // delete Item from List
        $('#deleteConfirmationSubmit').click(function (e) {

    debugger;
    varrestUrl = absuluteUrl+ "/_api/web/lists/GetByTitle('NGODoc')/items(" + $('#deleteId').val() + ")";
    varvdigest=getFormDigestValue();
          $.ajax({
    url: restUrl,
    type: "DELETE",
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": vdigest,
    "IF-MATCH": "*",
    "Content-Type": "application/json;odata=verbose"
              },
    success: function(data)  
              { 

              (<any>$('#deleteFiles')).modal('hide');
    toastr.success("File Successfully Deleted.", "Success");
    PopulateGrid();    
              }, 
    error: function(data) 
              { 

    toastr.error("File Successfully Error .", "Error Message")
    //alert(data.responseJSON.error); 
              }
          });


        });


      });

    functionPopulateGrid() {
    //Clear datatables
        $('#FilesGrid').empty();
    //Get File list items
        $.ajax({
    url: RestUrl,
    method: "GET",
    headers: {
    "accept": "application/json;odata=verbose"
            },
    success: function (data) {
    if(data.d.results.length>0) {
    console.log(data.d.results);
    //construct HTML Table from the JSON Data
                    $('#FilesGrid').append(GenerateTableFromJson(data.d.results));
    //Bind the HTML data with JqueryDataTable
    varoTable = (<any>$('#FilesTable')).DataTable({
    //control which datatable options available
    dom: 'Bfrltip',
    //add select functionality to datatable
    select: true,
    //adjust column widths
    "columns": [
    null,
    null,
    null,
    null,
    null,
                        { "width": "8%" }
    ],
    //remove sort icon from actions column
    "aoColumnDefs": [
    { "bSortable": false, "aTargets": [5] }
                        ],
    // start  Code for  Footer Fiter by Column value
    initComplete: function () {
    this.api().columns().every( function() {
    varcolumn = this;
    varselect = $('<select><option value=""></option></select>')
                                    .appendTo( $(column.footer()).empty() )
                                    .on('change', function () {
    varval = $.fn.dataTable.util.escapeRegex(
                                            $(this).val()
                                        );
    column
                                            .search(val ? '^'+val+'$' :'', true, false )
                                            .draw();
                                    } );

    column.data().unique().sort().each( function ( d, j ) {
    select.append('<option value="'+d+'">'+d+'</option>' )
                                } );
                            } );
                        }
                    });
    // This code For Footer Going on Head Above section
                        

                    $('#FilesTabletfoottr').insertBefore($('#FilesTabletheadtr'))
    // This code For Footer Going on Head Above section
    // start  Code for  Footer Fiter by Column value
                } else {
                    $('#FilesGrid').append("<span>No Files Found.</span>");
                }
            },
    error: function (data) {
                $('#FilesGrid').append("<span>Error Retreiving Files. Error : " + JSON.stringify(data) + "</span>");
            }
        });
    };

    //Generate html table values
    functionGenerateTableFromJson(objArray) {
    vartableContent =
    '<table id="FilesTable" class="table table-striped table-bordered" cellspacing="0"">' +
    '<thead><tr>' +
    '<th>ID</th>' +
    '<th>File Name</th>' +
    '<th>File Company</th>' +
    '<th>File Description</th>' +
    '<th>Phone</th>' +
    '<th>Actions</th>' +
    '</tr></thead>' +

    '<tfoot><trvalign="top">' +
    '<th>ID</th>' +
    '<th>File Name</th>' +
    '<th>File Company</th>' +
    '<th>File Description</th>' +
    '<th>Phone</th>' +
    '</tr></tfoot>' ;



    for(vari = 0; i<objArray.length; i++) {
    tableContent += '<tr>';
    tableContent += '<td>'+ objArray[i].ID + '</td>';

    tableContent += '<td><a  href=\''+objArray[i].FileRef +'\'  target="_blank">'+ objArray[i].FileLeafRef +'</a></td>';
    // tableContent += '<td>' + objArray[i].FileLeafRef + '</td>';
    tableContent += '<td>'+ objArray[i].Company + '</td>';
    tableContent += '<td>'+ objArray[i].FileDescription + '</td>';
    tableContent += '<td>'+ objArray[i].Phone + '</td>';
    tableContent += "<td><a id='" + objArray[i].ID + "' href='#' style='color: orange' class='confirmEditFileLink'>" +
    "<i class='glyphiconglyphicon-pencil' title='Edit File'></i></a>&nbsp&nbsp";
    tableContent += "<a id='"+ objArray[i].ID + "' href='#' style='color: red' class='confirmDeleteFileLink'>"+
    "<i class='glyphiconglyphicon-remove' title='Delete File'></i></a>&nbsp&nbsp";
    tableContent += "<a id='"+ objArray[i].ID + "' href='#' class='confirmListItemDetailsLink'>"+
    "<i class='glyphiconglyphicon-cog' title='Link to List Item'></i></a></td>";
    tableContent += '</tr>';
        }
    returntableContent;
    };
    // Edit button click event
    $(document).on('click', '.confirmEditFileLink', function (e) {
    debugger;
    e.preventDefault();
    varid = this.id;
    //alert(id);
    varrequestUri = absuluteUrl+ "/_api/web/lists/getByTitle('NGODoc')/items(" + id + ")?$expand=File&$select=id,Title,Company,FileDescription,Phone,EncodedAbsUrl,FileRef,FSObjType,FileLeafRef,Folder/ServerRelativeUrl";
    console.log(requestUri);
        $.ajax({
    url: requestUri,
    method: "GET",
    contentType: "application/json;odata=verbose",
    headers: {
    "accept": "application/json;odata=verbose",
    "content-Type": "application/json;odata=verbose"
          },
    success: function (data) {
    // $("#uploadFile").val(data.d.FileRef) ;
                $("#fileDescription").val(data.d.FileDescription) ;
                $("#fileCompany").val(data.d.Company) ;
                $("#filePhone").val(data.d.Phone) ;
                $('#fileId').val(id);
                $('#myModalLabel').html('Edit File');
                (<any>$('#myModalNorm')).modal('show');
                $("#etag").val(data.d.__metadata.etag);
            },
    error: function(data) 
            { 
    toastr.error("File Successfully Error .", "Error Message")
    //alert(data.responseJSON.error); 
            }

        });
    });
    //Link to files list item
    $(document).on('click', '.confirmListItemDetailsLink', function (e) {
    e.preventDefault();
    varid = this.id;
    varrequestUri = absuluteUrl+ "/Lists/NGODoc/DispForm.aspx?ID=" + id;
    window.location.href = requestUri;
    });
    // Delete button click event
    $(document).on('click', '.confirmDeleteFileLink', function (e) {
    e.preventDefault();
    varid = this.id;
        $('#deleteId').val(id);
        (<any>$('#deleteFiles')).modal({
    show: true
            })
    });
    //Update Model Label
    functionupdateFormLabel() {
        $('#myModalLabel').html('Add New File');
    };
    //Populate then display modal dialog for add file button clicked
    $(document).on('click', '.addNewFile', function (e) {
        $('#myModalLabel').html('Add New File');
        $("#uploadFile").val("") ;
        $("#fileDescription").val("") ;
        $("#fileCompany").val("") ;
        $("#filePhone").val("") ;
        (<any>$('#myModalNorm')).modal('show');
    });

    //Fuction for export to excel
    $(document).on('click', '.addexportToExcel', function (e) {

    });

    // Update file function
    functionUpdateFiles(id) {
    debugger;
    varFileDescription =$("#fileDescription").val() ;
    varCompany =$("#fileCompany").val() ;
    varPhone =$("#filePhone").val() ;
    vareTag = $("#etag").val();
    varrequestUri = absuluteUrl + "/_api/web/lists/getByTitle('NGODoc')/items(" + id + ")";
    varfileData = {
           __metadata: { "type": "SP.Data.NGODocItem" },
    FileDescription: FileDescription,
           Phone: Phone,
           Company: Company
       };
    varrequestBody = JSON.stringify(fileData);
    varvdigest=getFormDigestValue();
    return$.ajax({
    url: requestUri,
    type: "POST",
    async:false,
    headers:{
    "Accept": "application/json;odata=verbose",
    "Content-Type": "application/json;odata=verbose",
    "X-RequestDigest": vdigest,
    "IF-MATCH": "*",
    "X-HTTP-Method": "MERGE"
           }
           ,
    data: requestBody,
    success: function(data)  
           {
             (<any>$('#myModalNorm')).modal('hide');

    PopulateGrid();    
    toastr.success("File Successfully Update .", "Success") ;   
           }, 
    error: function(data) 
           { 
            (<any>$('#myModalNorm')).modal('hide');
    toastr.error("File Successfully Error  .", "Error Message") ;
    //alert(data.responseJSON.error); 
           }

       });
    }
    //Add File function

    functionaddFile() {
    varfiles = (<HTMLInputElement>document.getElementById('uploadFile')).files;
    //in case of multiple files,iterate or else upload the first file.
    varvdigest=getFormDigestValue();
    for(varx = 0; x <files.length; x++) {          
    varfile =files[x] ;
    //var reader = new FileReader();
    // reader.onloadend = function(evt)
    // {
    varcompleteUrl = absuluteUrl +"/_api/web/GetFolderByServerRelativeUrl('NGODoc')/Files/add(url='" + file.name + "',overwrite=true)?$select=*&$expand=ListItemAllFields";

            $.ajax({
    url: completeUrl,
    type: "POST",
    data: file,
    async: false,
    processData: false,
    headers: {
    "Accept": "application/json;odata=verbose",
    "Content-Type": "application/json;odata=verbose",
    "X-RequestDigest": vdigest,
                   },
    complete: function (data) {
    //alert(data.responseJSON.d.ListItemAllFields.Id);// Get Id from uploaded docs Id
    // update meta Data or Other Column
                       $.ajax({
    url: absuluteUrl +"/_api/Web/Lists/getByTitle('NGODoc')/Items("+data.responseJSON.d.ListItemAllFields.Id+")",
    type: "POST",
    data: JSON.stringify({
    "__metadata": { type: "SP.Data.NGODocItem" },
    FileDescription: $('#fileDescription').val(),
                           Company: $('#fileCompany').val(),
                           Phone:  $('#filePhone').val(),

                       }),
    headers: {
                           Accept: "application/json;odata=verbose",
    "Content-Type": "application/json;odata=verbose",
    "X-RequestDigest": vdigest,
    "IF-MATCH":"*",
    "X-Http-Method": "MERGE"
                       },
    success: function (data) {

                          (<any>$('#myModalNorm')).modal('hide');
    PopulateGrid(); 
    toastr.success("File Successfully Uploaded.", "Success");
                          $("#uploadFile").val("") ;
                          $("#fileDescription").val("") ;
                          $("#fileCompany").val("") ;
                          $("#filePhone").val("") ;

                         },
    error: function (err) {
    console.log(err);
                           }
                   });
                   },
    error: function (err) {
    // alert('failed');
                   }
               });

    //};
    //reader.readAsArrayBuffer(file);
    }  



    };




    functionPrintDocument(divName) {
    varprintcontents = document.getElementById(divName).innerHTML;
    varoriginablecontents = document.body.innerHTML;
    document.body.innerHTML = printcontents;
    window.print();
    document.body.innerHTML = originablecontents;
     }
    // Geting the formdigest value
    functiongetFormDigestValue()
    {
    varvretrun="";
      $.ajax({
    url: absuluteUrl + "/_api/contextinfo",
    method: "POST",
    async:false,
    headers: {
    "Accept": "application/json; odata=verbose",
    "content-Type": "application/json;odata=verbose"

      },
    success: function (data) {
    debugger;
    vretrun=data.d.GetContextWebInformation.FormDigestValue;
    //console.log(vretrun);
    returnvretrun;
        },
    error: function (data, errorCode, errorMessage) {
    toastr.error("File Successfully Error .", "Error Message")
    alert(errorMessage)
        }

    });
    returnvretrun;
    }

    }  protectedgetdataVersion(): Version {
    returnVersion.parse('1.0');
      }
    protectedgetPropertyPaneConfiguration(): IPropertyPaneConfiguration {
    return{
    pages: [
            {
    header: {
    description: strings.PropertyPaneDescription
              },
    groups: [
                {
    groupName: strings.BasicGroupName,
    groupFields: [
    PropertyPaneTextField('description', {
    label: strings.DescriptionFieldLabel
                    })
                  ]
                }
              ]
            }
          ]
        };
      }
    }

    3-Config.js
    {
    "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
    "version": "2.0",
    "bundles": {
    "spfx-web-part": {
    "components": [
            {
    "entrypoint": "./lib/webparts/spfx/SpfxWebPart.js",
    "manifest": "./src/webparts/spfx/SpfxWebPart.manifest.json"
            }
          ]
        },
    "spfxseparatfile-web-part": {
    "components": [
            {
    "entrypoint": "./lib/webparts/spfxseparatfile/SpfxseparatfileWebPart.js",
    "manifest": "./src/webparts/spfxseparatfile/SpfxseparatfileWebPart.manifest.json"
    }
          ]
        },
    "ngo-file-upload-web-part": {
    "components": [
            {
    "entrypoint": "./lib/webparts/ngoFileUpload/NgoFileUploadWebPart.js",
    "manifest": "./src/webparts/ngoFileUpload/NgoFileUploadWebPart.manifest.json"
            }
          ]
        },
    "image-gallery-web-part": {
    "components": [
            {
    "entrypoint": "./lib/webparts/imageGallery/ImageGalleryWebPart.js",
    "manifest": "./src/webparts/imageGallery/ImageGalleryWebPart.manifest.json"
            }
          ]
        }
      },
    "externals": {
    "jquery": {
    "path": "./node_modules/jquery/dist/jquery.min.js",
    "globalName": "jQuery"
        },
    "toastr": {
    "path": "./node_modules/toastr/toastr.js",
    "globalName": "jQuery"
        },
    "tether": {
    "path": "node_modules/tether/js/tether.js",
    "globalName": "jQuery"
        },
    "datatables.select": {
    "path": "../../../node_modules/datatables.net/js/jquery.dataTables.min.js",
    "globalName": "datatables.select",
    "globalDependencies": [
    "jquery"
          ]
        }
      },
    "localizedResources": {
    "SpfxseparatfileWebPartStrings": "lib/webparts/spfxseparatfile/loc/{locale}.js",
    ss
      }
    }



    Get No Of days between two Date from and To using Jquery

    $
    0
    0
    <!DOCTYPE html>
    <html>
    <title>Web Page Design</title>
    <head>
    <script>
    var monthNames = [ "January", "February", "March", "April", "May", "June",
            "July", "August", "September", "October", "November", "December" ];
            var daysOfMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
           
            var sum=0;
            var All=100;

    function diff(from, to) {
        var arr = [];
        var datFrom = new Date(from);
        console.log(datFrom);
        var datTo = new Date(to);
        console.log(datTo);
        var fromMonth=datFrom.getMonth();
        var fromYear =  datFrom.getFullYear();
        var toMonth=datTo.getMonth();
        var toYear =  datTo.getFullYear();
        if((fromMonth==toMonth) && (fromYear==toYear))
        {
            console.log('yes');
            var diffTime = Math.abs(datFrom - datTo);
            var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
            console.log(diffDays);
            console.log(monthNames[toMonth]);
            console.log(daysOfMonth[toMonth]);
            sum +=(All*diffDays)/(daysOfMonth[toMonth]);
            console.log(sum);
        }else
        {
            console.log('No');
            var diffYear = (12 * (toYear - fromYear)) + datTo.getMonth();

        for (var i = datFrom.getMonth(); i <= diffYear; i++) {
            arr.push(daysOfMonth[i % 12]+ "" + [i%12] + "" + Math.floor(fromYear+(i/12)));
           // console.log(i);
            if(i == datFrom.getMonth() || i >= diffYear )
            {
                //console.log(daysOfMonth[i % 12]);
            }else
            {
                console.log(monthNames[i]);
                console.log(daysOfMonth[i % 12]);
                console.log('-----');
                sum +=(All*daysOfMonth[i % 12])/(daysOfMonth[i % 12]);
            }
           
           
        }
        if(arr.length>=2)
        {
           // console.log(arr[0]);
              var dateFromFormat=(parseInt(arr[0].split('')[1]) + 1)+ ''+arr[0].split('')[0] + '' + arr[0].split('')[2];
           
            var date2From = new Date(dateFromFormat);
           // console.log(datFrom.getMonth());
            // console.log(date2From.getMonth());
           
            var diffTimeFrom = Math.abs(date2From - datFrom);
            var diffDaysFrom = Math.ceil(diffTimeFrom / (1000 * 60 * 60 * 24));
            console.log(monthNames[parseInt(arr[0].split('')[1])]);
            console.log(daysOfMonth[parseInt(arr[0].split('')[1])]);
            console.log(diffDaysFrom);
            console.log('-----');
            sum +=(All*diffDaysFrom)/(daysOfMonth[parseInt(arr[0].split('')[1])]);
           // console.log(arr[arr.length -1]);
            var dateToFormat=(parseInt(arr[arr.length -1].split('')[1]))+ ''+arr[arr.length -1].split('')[0] + '' + arr[arr.length -1].split('')[2];
           //  console.log(dateToFormat);
            var date2To = new Date(dateToFormat);
           // console.log(datTo);
            var diffTimeTo = Math.abs(date2To - datTo);
            var diffDaysTo = Math.ceil(diffTimeTo / (1000 * 60 * 60 * 24));
            console.log(monthNames[parseInt(arr[arr.length -1].split('')[1])]);
            console.log(daysOfMonth[parseInt(arr[arr.length -1].split('')[1])]);
            console.log(diffDaysTo);
            console.log('-----');
            sum +=(All*diffDaysTo)/(daysOfMonth[parseInt(arr[arr.length -1].split('')[1])]);
        }
        console.log(sum);
        //console.log(arr[0].split('')[0]);
        return arr;
        }
       
       
    }

    console.log(diff('05 12 2013', '07 28 2013'));
    </script>
    </head>
    <body>
    </body>
    </html>

    HOW TO GET STARTED WITH REACT FOR BUILDING ADVANCED SPFX SOLUTIONS

    $
    0
    0

    TABLE OF CONTENTS

    1. Getting started with React in SPFx projects
      1. Project setup and structure
      2. Referencing a React component in your SPFx solution
      3. Creating a React class component
      4. Best practices
      5. Taking advantage of the already available controls
    2. React fundamentals
      1. Props & state
      2. Lifecycle methods
      3. Event handlers
    3. Splitting components
    4. Passing state between components
      1. The render prop technique
      2. Redux
      3. React hooks
    5. Things to avoid
      1. Copying props to state
      2. Using unsafe lifecycle methods
    6. What next?

    GETTING STARTED WITH REACT IN SPFX PROJECTS

    PROJECT SETUP AND STRUCTURE

    Creating an SPFx project with React happens the same way as setting up a solution without a framework, except now you need to select React as the “framework” you wish to use. Below you can see a picture of what the project structure looks like immediately after it has been generated. As the size of your project grows, consider adding more folders to organize your code.

    REFERENCING A REACT COMPONENT IN YOUR SPFX SOLUTION

    React components are the individual building blocks you implement and use for creating your complete React solution. There can be different sized components, and they can be nested with one another. A component can be as small as a single input field, or much larger, such as an entire form (which can contain the input field). Typically, each (class) component has its own file where its lifecycle methods, event handlers, and optionally also props and state are defined.
    When you generate a new React SPFx project, you can see an example of how to reference a React component and get it rendered by your SPFx solution. When you reference a component, you need to initialize its props by passing values to all of the different properties it has. By default, the generated React component only has the description prop, and here it is getting its value based on what the user has set as the description in the SPFx web part properties.
    public render(): void{
    const element: React.ReactElement<ICatsProps> = React.createElement(
    Cats,
    {
    description: this.properties.description
    }
    );
    ReactDom.render(element, this.domElement);
    }
    When you want to reference a React component inside another React component, it is enough that you just create the child component in the render method of the parent component by doing either one of the following.
    { React.createElement(Cat, { name: "Whiskers", color: "Brown"})}
    <Cat name={"Whiskers"} color={"Brown"} />

    CREATING A REACT CLASS COMPONENT

    In the components folder of a new SPFx project, you already have .tsx file named after your web part. In this component file, you’ll need the essential imports, interfaces, and class methods. Some people prefer to have the props and state interfaces in separate files, but I find it easier to have them in the same file.
    import * as React from 'react';
    export interface ICatsProps{
    /* You will define your props here */
    }
    export interface ICatsState{
    /* You will define your state here */
    }
    export default class Cats extends React.Component<ICatsProps, ICatsState>{
    public constructor(props: ICatsProps){
    super(props);
    this.state = {/* You will initialize your state here */};
    }
    public render(): React.ReactElement<ICatsProps>{
    return(
    <div>
    {/* You will define the elements you want to render - possibly conditionally based on state - here */}
    </div>
    );
    }
    }
    The props interface contains read-only properties that you initialize when you call the component as a part of your solution. You can think of them as parameters. The state interface again is used for tracking the current state of the component, and – unlike props – it can be changed to reflect fetched information or user input. We’ll take a closer look at props and state a bit later in this article.

    THE CONSTRUCTOR

    If you are creating a class component and are planning on using state, you’ll need a constructor. In it, we must always call super() to instantiate the parent class which, for example, grants us the ability to use this. You can call super() with props or without, but if you use it without, this.props will be undefined if you attempt to use it in the constructor. To avoid getting confused if you later want to use this.props in your constructor and forget that you need to initialize props first, you can always call super(props) just in case.
    You also need to initialize the component state in the constructor using the this.state = { ... } notation. If for some reason you don’t need to use state (in which case you are creating a fully controlled component), then you don’t necessarily even need the constructor, and you can get rid of the state interface completely and replace its reference in your class definition with {}. Also, if you don’t need to use state, you might want to consider creating a functional component instead of a class component.

    THE RENDER METHOD

    render() is the only truly compulsory method in a React class component. The method should return the elements you wish your component to render. By default, there should always be just one root element, so if you are returning multiple elements, make sure to wrap them inside a single div. Another option is to use React.Fragment.
    When you define elements in a React component, the syntax is called JSX (JavaScript syntax extension). There are some differences between JSX and regular HTML when it comes to defining element properties. For example, class in HTML is className in JSX. You’ll learn these very quickly, especially when using a code editor with IntelliSense such as Visual Studio Code.
    The render method gets executed only and always when the component props or state changes. This behavior allows us to make components look different in different situations. More about this when we discuss props and state.

    BEST PRACTICES

    There are a couple of best practices you should keep in mind when creating SPFx projects with React:
    1. The SharePoint Framework web part context is not directly available in React components. If you need to use things like MSGraphClient or AadHttpClient in your React component, you might be tempted to pass the whole this.context down to your React component. Don’t do it! Instead, do either one of the following:
    • Pass only the individual objects from the context that you truly need to your child component. This is sufficient if your solution is very simple.
    • If your solution is more complex, doing the previous will most likely lead you to pass down a large number of different properties, objects, and methods to your child components as props. This will make your solution very hard to maintain. Instead, you should rather create a service (singleton) with methods where you do all the things that require information from the context. Then you can use that service and its methods from your React components. Check out my blog post How to use the service locator pattern in SPFx solutions for more detailed instructions.
    2. Do all the SharePoint Framework specific things in the web part/extension part of the solution.
    When you follow these two above principles, it helps with unit testing and moving the code away from SharePoint if needed.
    3. Don’t manually upgrade the React version that is included when you generate the SPFx project if you want to avoid breaking things.

    TAKING ADVANTAGE OF THE ALREADY AVAILABLE CONTROLS

    Another nice thing about using React in your SPFx projects is that you get to take advantage of the Office UI Fabric React and PnP SPFx React controls. With these controls, you can easily build graphical user interfaces that have a high level of functionality and the same look and feel as the rest of Office 365. No need to reinvent the wheel yourself!
    I also found the code samples on the Office UI Fabric website super helpful on my React learning journey. The samples show you how to use the controls, and you learn a thing or two about React at the same time.
    Another great place to see how to do something is to look at the SPFx web part and extension samples. Can you find something similar to what you want to accomplish? Look at the source code of that sample and use it as an example!

    REACT FUNDAMENTALS

    PROPS & STATE

    In my opinion, the most elementary thing you need to grasp about React is how to use props and state. Everything revolves around and always comes back to them. When I earlier said that React is more about learning a new way of thinking, this is it.
    The props are read-only properties you set values to when you call your React component. They are a way to transfer information from the parent component to the child. You can also use them in your React component to control how it behaves in different situations – when different kind of data is passed down to it.
    The state can also be used for controlling, e.g., how your component is rendered. What makes state different from props is that you can change its values. You typically initialize state with null values in the constructor and later change the values when something happens in the component to reflect that change – the new state of the component.
    Remember when I said earlier that the render() method is executed whenever the props or state changes? You can change the state by calling the this.setState() method, and that will make your render method execute again, taking into account the new state values. There is also another way to set state: this.state = { ... } but that should only be used in the constructor as it does not trigger the render method execution.

    CONDITIONAL RENDERING

    Whenever you want to manipulate the DOM to, e.g., hide something, you do it via the state instead of changing element properties. In React, you never do things like document.getElementById() and then attempt to hide that element. You render your component conditionally based on its state.
    Here I am controlling whether a button is enabled or disabled via state. By default, the button is enabled, because I am setting this.state = { buttonDisabled: false }; in the constructor. The button will remain enabled until I call this.setState({ buttonDisabled: true}) somewhere else in my code (e.g., immediately after a button click, so the user can’t click the button again). I am also rendering the button only when this.props.buttonText is something else than null: if someone decides to pass null to the component as the buttonText value, then the button will not be shown.
    export interface ICatsProps {
    buttonText: string;
    }
    export interface ICatsState {
    buttonDisabled: boolean;
    }
    export default class Cats extends React.Component<ICatsProps, ICatsState>{
    public constructor(props: ICatsProps){
    super(props);
    this.state = { buttonDisabled: false};
    }
    public render(): React.ReactElement<ICatsProps>{
    return(
    this.props.buttonText ?
    <button disabled={this.state.buttonDisabled}>{this.props.buttonText}</button>
    :null
    );
    }
    }
    How you manage your component through its state might feel a bit hard to grasp at first, but it will become like a second nature soon enough. It is the single most crucial thing to understand about React, so don’t you dare to attempt to manipulate the elements in the traditional way in a React solution! *shakes finger* 😀

    USING STATE TO STORE AND DISPLAY DYNAMIC DATA

    In addition to controlling how your component is rendered based on state values, the state can also be used for storing data. The data can first be fetched from somewhere and then set to the state by using this.setState(). That will then trigger the render() method, which allows you to display the data by referencing the state.
    The state can also be used to store the values user inputs through input controls. When the user submits the form, the data contained in the state can be sent to an API to get processed.
    Remember to always check the state for null values before rendering if you are using null for initializing the state in the constructor. If you attempt to render the properties of an object that is null, you’ll get an exception.
    export interface ICatsState {
    cats: ICat[];
    }
    export default class Cats extends React.Component<ICatsProps, ICatsState>{
    public constructor(props: ICatsProps){
    super(props);
    this.state = { cats: null};
    }
    public render(): React.ReactElement<ICatsProps>{
    return(
    <div>
    {this.state.cats ?
    this.state.cats.map((cat) =>(
    {React.createElement(Cat, { name: cat.name, color: cat.color})}
    ))
    :null}
    </div>
    );
    }
    }
    The state is truly the thing where all the magic is happening. Whenever you find yourself thinking hmm, usually I’d start by calling document.getElementWithId, you want to use state instead.
    Now you may be wondering, where should I call the this.setState() method to change the state and hence how the component is rendered? You have two options: lifecycle methods and event handlers.

    LIFECYCLE METHODS

    React has many lifecycle methods that allow you to change the state whenever the component is added, updated, or removed. You can find a list of all lifecycle methods in, e.g., the official React documentation but let me tell you a little bit about a couple of them I’ve found myself using the most.

    COMPONENT DID MOUNT

    If you need to fetch data from a data source – such as Microsoft Graph or a database via a custom API hosted in Azure – to be displayed by your component when the page is loaded, you should do it in the componentDidMount() method, because:
    • Fetching data in the componentDidMount() method of your component allows the rest of your SPFx solution to get rendered already before the slow data fetch has completed, leading to better performance and user experience. You can use the developer tools in Chrome to see how your SPFx solution gets rendered on slow connections.
    • You can’t use the async/await pattern all the way up to the render() method.
    To get your component to display dynamic data immediately after the component is added to the DOM, fetch it in the componentDidMount() method and then set the data to the component state using this.setState(). When you do this, the render() method is fired automatically where you can reference the state value to display the fetched data. Here I am fetching some data based on the id the component receives as a prop, and setting it to the state.
    public async componentDidMount(){
    var cat = await this.getCat(this.props.id);
    this.setState({ cat: cat });
    }

    COMPONENT DID UPDATE

    Sometimes you might need to refresh the state of your child component when something happens in the parent component. In such a situation, your parent component calls the child component with new props, and fires the componentDidUpdate() lifecycle method. In that lifecycle method, you can then set the state of your child component to reflect those new properties.
    Note that this lifecycle method also gets executed whenever the state of your component changes, and if you happen to setState() here, you have an infinite loop. To avoid this, you should check if the property you are basing your refresh behavior on has actually changed. For this purpose, you should utilize the prevProps argument that is automatically available in the componentDidUpdate() lifecycle method, and only proceed to update the state if that prop has a different value.
    public async componentDidUpdate(prevProps){
    if(prevProps.id === this.props.id)return;
    var cat = await this.getCat(id);
    this.setState(cat: cat);
    }
    I’ve found this useful, for example, when I have been using the Office UI Fabric DetailsList and Panel components: the Panel content needs to change depending on the selected DetailsList item.
    1. When an item is selected on the DetailsList, the parent component’s this.state.selection is updated which triggers the render method of the parent component.
    2. In the render method, the parent component passes the currently selected item from its state to the child component — which contains the Panel — as a prop.
    In the componentDidUpdate() method of the child component, we first need to check if the selection is different than previously. If yes, we set the information from the selection to an object and save it to the child component’s state.
    public async componentDidUpdate(prevProps){
    if(prevProps.selection === this.props.selection)return;
    var cat: ICat = {
    id: selection["id"],
    name: selection["name"],
    color: selection["color"]
    };
    this.setState({ cat: cat });
    }
    3. We can then get the values from that state to be displayed in the text fields in the panel during the render() of the child component.

    EVENT HANDLERS

    Event handlers are methods you bind to certain control events, such as when a user presses a button. You might, for example, have a form with text fields, drop-downs, toggles, and so forth, and want to collect the data user inserts using those controls, and finally, send the information somewhere when the user clicks on a button.
    You can collect the information the user inserts by binding event handlers to the controls, and calling this.setState() to save the entered data to the state. Note that you can’t directly update a specific object property stored in the state. You first need to get the entire object from the state, then update that single property, and then set that entire (now updated) object back to the state.
    private onChangedColor = (value: string) =>{
    var cat = this.state.cat;
    cat.color = value;
    this.setState({ cat: cat });
    }
    When the user eventually clicks on the Save button and triggers the onSaveButtonClick() event handler, you can fetch all the information the user has previously inserted on the form from the state, and send the data forward to get processed.
    private onSaveButtonClick = async(): Promise<void> =>{
    var cat = this.state.cat;
    if(cat.name === null|| cat.color === null){
    this.setState({ showError: true});
    }
    else{
    await this.save(cat);
    }
    }
    Using the arrow functions for binding event handlers hasn’t always been possible, and sometimes you might still encounter React projects where the event handlers get bound in the constructor, like below.
    this.onChangedColor = this.onChangedColor.bind(this);
    this.onSaveButtonClick = this.onSaveButtonClick.bind(this);
    You can imagine that if there are a lot of event handlers, binding them in the constructor will lead to the constructor becoming enormous. Using the arrow functions allows us to save space. Also, it is far too easy to forget to bind a new event handler if you need to do it separately in the constructor. Forgetting to do that will result in incorrect behavior.

    SPLITTING COMPONENTS

    Splitting your solution to smaller nested React components is a common thing to do. Here are some simple guidelines for when you should create child components instead of having everything in one component.
    • Create a separate component when the component needs to appear multiple times or in several different places. As with any coding project, avoid repeating the same code in multiple places.
    • The component is a logically separate entity.
    • The component needs to have its own set of properties and state to accomplish what you want to do.

    PASSING STATE BETWEEN COMPONENTS

    Passing state between components is probably the first “advanced” case you’ll start looking into with React: you have nested components, and you need to share a state between them. Let’s use the already mentioned Office UI Fabric DetailsList and Panel as an example again.
    Imagine a situation in which you have the Office UI Fabric DetailsList, and you want to edit one of the items via the Panel. You need to be able to control when that panel is open (displayed) and closed (hidden). That happens via a state that needs to be shared by both components: the list (parent) and the panel (child).

    THE RENDER PROP TECHNIQUE

    There is a native way of doing this for simple cases called the render prop technique. When using this technique, you have the shared state in the parent component, and in that parent component, you also have a function (event handler) that changes the state.
    export interface ICatsState {
    showPanel: boolean;
    }
    private hidePanel = async(): Promise<void> =>{
    this.setState({ showPanel: false});
    }
    You can then pass that function to the child component as a prop. When you need to change the state in the parent, you call the function in the child component by referencing the function in its props.
    <EditCat hidePanel={this.hidePanel} />
    export interface IEditCatProps {
    hidePanel: any;
    }
    <button onClick={this.props.hidePanel}>{strings.Close}</button>

    REDUX

    If your solution is enormous, and you have multiple component layers (components, inside components, inside components, etc.), the render prop technique can make the project quite messy and hard to follow. In these more advanced scenarios, Redux can make it easier for you to handle state through all those layers.
    Redux is a separate tool you can include in your React project to help you manage the state between components. It is yet another thing to learn, though. When people have experienced React to be difficult to learn, it has probably been because they’ve had to learn both React and Redux at the same time. If your project is small or medium, introducing Redux is probably overkill and will introduce unneeded complexity.

    REACT HOOKS

    React version 16.8 – which the current SPFx version supports – introduced a new feature called React Hooks that offers us an another native way of passing state between components. Ever since its release, there has been a lot of debate whether React Hooks can replace Redux entirely or not in this regard. Some say it can; some say it can’t. Perhaps React Hooks is the optimal solution for those middle-ground cases when you have more than two layers of components, but your project isn’t yet so big that you want to introduce Redux to it.

    THINGS TO AVOID

    There are many different ways of accomplishing the same things in React. Some are considered as the best practices while others as anti-patterns — the things you should not be doing. If you ever catch yourself doing something that feels a bit “hacky”, do a quick search to ensure you are not implementing an anti-pattern, and learn the right way of doing the thing instead.

    COPYING PROPS TO STATE

    One of the most common anti-patterns is copying props to state. When you do this, you create a “second source of truth”, which can lead to bugs. The only exception is if you need to seed the props to create the component’s initial state.

    USING UNSAFE LIFECYCLE METHODS

    There are some legacy lifecycle methods that have been marked as UNSAFE. Those methods will discontinue working in React version 17. As of this writing, the latest SPFx version (1.9.1) uses React version 16.8.5, so those unsafe lifecycle methods such as componentWillReceiveProps() currently work. However, to make your solution future-proof, avoid using these methods and use the recommended alternatives instead.
    Viewing all 542 articles
    Browse latest View live