Posts

Showing posts with the label client side

List View row Formatting: Discussion Board

Image
Hi Friends, I have seen that in on-prem many of the users are using the discussion feature, but in SharePoint Online we do not have this feature. To give it a thought I have implemented somewhat similar functionality. Discussion board formatting gives the ability to showcase the discussion which is a page, under specific category which will make more sense to the discussion board. So, whatever category you want to create, create the folder for that and the corresponding pages beneath it. This discussion board formatted displays the banner image (not the thumbnail image) and showcases it in the front along with the title, description, Likes, Comments, Date of last edit, and the owner of the page(not the author). No new column needs to be created only the existing column needs to be added to the view. For that execute the below PnP code # If want to modify the existing view Set-PnPView   - List  " Site Pages "   - Identity  " ...

Sorting in Typescript (Simple Arrays & Array of Objects)

Image
Hi Friends, This post is not regarding the SharePoint but it is a very common functionality that we need in day to day coding. So I thought to write down here. This functionality is of sorting in Typescript. Sorting simple Arrays Sorting is the very basic functionality that is required and when it comes to typescript  we do get OOB method, but that is for the simple array.    let  fruits : string []  =  [ ' Banana ' ,  ' Orange ' ,  ' Apple ' ,  ' Pineapple ' ] ;    console . log (fruits. sort ()); Output : Apple, Banana, Orange, Pineapple Sorting an Array of Objects When it comes to sorting the array of objects, we do not have any OOB method which can serve our purpose. for this, we have to write our small custom logic within the sort method let  fruits :   any []  =  [{ Name :   ' Banana '  }, { Name :   ' Orange '  },  { Name :   ' Appl...

4 Useful VS Code extensions for SharePoint Framework components

Image
Hi Friends, Today I will talk about the most useful VS Code extensions, that will help in the productivity of specifically SharePoint Framework projects. As a developer, we waste a lot of time in the tasks that could be done easily via extensions support or shortcut keys. In this blog post, I will discuss some of these extensions that will increase the productivity and the style of your code. With an increase in productivity, the styling also holds an important value as it makes the code more readable and understandable which increases the focus time. So let's dive then !! VS Code Extensions !! Debugger for Chrome:  A very important extension if you are a SharePoint online developer (developing SharePoint framework components) then it is a must to have this extension. This extension helps in debugging the SharePoint Framework components just as we used to do in the C# server-side coding. For details on how to configure, you ca...

Useful RegEx patterns

Image
Hi Friends, Today I am not writing something about the SharePoint, but this will be more useful for the client side development. So in many scenarios we need to validate the input string eg valid email address and more. I have found some of the common used validations which we can validate using the regular expressions. I'll be adding more to these as I encounter more and feel free to let me know if you need any more. Commonly used Regular Expressions Title Description Regular Expression Date Time Format Regular expression will match the dates with dashes or slashes or spaces. eg: dd-mm-yyy or dd/mm/yyy and optional time separated by space or dash eg: dd-mm-yyy-hh:mm:ss /^(0?[1-9]|[12][0-9]|3[01])([ \/\-])(0?[1-9]|1[012])\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$/ 24 hour time format Regular expression to matches time in 24 hour ...

SharePoint Framework Weather webpart

Image
Hi Friends, I have come up with a weather webpart, to let you know about the weather outside event when you are working inside. Weather webpart is the most common webpart many of the user love to have them on their site. So, I have created a weather webpart which fetches its data from yahoo and displays in a very beautiful format. Webpart Features Weather webpart displays the following information High Temperature Low Temperature Wind speed Humidity Sunrise Sunset Condition Image Forecast for upto 10 days Day and date display for easy readability You can configure the webpart with just few clicks Enter any City name and see the results right away Option to select between the Celsius and Fahrenheit Select how many days to be displayed in the forecast. Easy to use slider to select the days Show the information when the information was last updated Option to display only the header with the temperature ...