<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/category/web/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Mon, 09 May 2022 07:45:52 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Binding buttons in SPFx</title>
		<link>https://blog.binarybits.net/binding-buttons-in-spfx/</link>
					<comments>https://blog.binarybits.net/binding-buttons-in-spfx/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 09 May 2022 07:44:06 +0000</pubDate>
				<category><![CDATA[React]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1570</guid>

					<description><![CDATA[<p>When writing a react based SPFx application one has to make a note that ES6 React.Component doesn&#8217;t auto bind methods to itself. Hence it&#8217;s required to manually bind and the following are two ways to do it. Method 1 onClick={this.addButtonClicked.bind(this)} Method 2 this.addButtonClicked = this.addButtonClicked.bind(this);</p>
<p>The post <a href="https://blog.binarybits.net/binding-buttons-in-spfx/">Binding buttons in SPFx</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When writing a react based SPFx application one has to make a note that ES6 React.Component doesn&#8217;t auto bind methods to itself.</p>



<p class="wp-block-paragraph">Hence it&#8217;s required to manually bind and the following are two ways to do it.</p>



<h2 class="wp-block-heading">Method 1</h2>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>onClick={this.addButtonClicked.bind(this)}</p></blockquote>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application/typescript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;TypeScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;typescript&quot;}">import * as React from 'react';

import { Stack, IStackProps, IStackStyles } from 'office-ui-fabric-react/lib/Stack';
import { ActionButton } from 'office-ui-fabric-react/lib/Button';
import { IIconProps } from 'office-ui-fabric-react/';

import { ITestComponentState } from './ITestComponentState';
import { ITestComponentProps } from './ITestComponentProps';

//Stack related styles
const outerStackTokens = {
    childrenGap: 50
};
const addFriendIcon: IIconProps = { iconName: 'Add' };

let outerStackStyles: Partial&lt;IStackStyles&gt; = {};
let innerStackColumnProps: Partial&lt;IStackProps&gt; = {};

export default class TestComponent extends React.Component&lt;ITestComponentProps, ITestComponentState&gt; {
    constructor(props: ITestComponentProps) {
        super(props);
        this.state = {
            items: []
        };
    }
  
    public render(): React.ReactElement&lt;{}&gt; {
        return (
            &lt;div&gt;
                &lt;Stack horizontal tokens={outerStackTokens} styles={outerStackStyles}&gt;
                    &lt;Stack verticalAlign=&quot;start&quot; {...innerStackColumnProps}&gt;
                        &lt;Stack.Item align=&quot;start&quot; &gt;
                            &lt;ActionButton iconProps={addFriendIcon} onClick={this.addButtonClicked.bind(this)} allowDisabledFocus disabled={this.state.sortItems.length &gt;= 10 ? true : false} &gt;Add Item&lt;/ActionButton&gt;
                        &lt;/Stack.Item&gt;
                    &lt;/Stack&gt;
                &lt;/Stack&gt;
            &lt;/div&gt;
        );
    }

    private addButtonClicked(event?: React.MouseEvent&lt;HTMLButtonElement&gt;) {
        let itemsOnAdd = this.state.items;
        let itemTitle = &quot;Item &quot; + (this.state.items.length + 1);
        itemsOnAdd.push({ title: itemTitle });
        this.setState({ items: itemsOnAdd });
    }
}</pre></div>



<h2 class="wp-block-heading">Method 2</h2>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>this.addButtonClicked = this.addButtonClicked.bind(this);</p></blockquote>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application/typescript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;TypeScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;typescript&quot;}">import * as React from 'react';

import { Stack, IStackProps, IStackStyles } from 'office-ui-fabric-react/lib/Stack';
import { ActionButton } from 'office-ui-fabric-react/lib/Button';
import { IIconProps } from 'office-ui-fabric-react/';

import { ITestComponentState } from './ITestComponentState';
import { ITestComponentProps } from './ITestComponentProps';

//Stack related styles
const outerStackTokens = {
    childrenGap: 50
};
const addFriendIcon: IIconProps = { iconName: 'Add' };

let outerStackStyles: Partial&lt;IStackStyles&gt; = {};
let innerStackColumnProps: Partial&lt;IStackProps&gt; = {};

export default class TestComponent extends React.Component&lt;ITestComponentProps, ITestComponentState&gt; {
    constructor(props: ITestComponentProps) {
        super(props);
        this.state = {
            items: []
        };
        this.addButtonClicked = this.addButtonClicked.bind(this);
    }
  
    public render(): React.ReactElement&lt;{}&gt; {
        return (
            &lt;div&gt;
                &lt;Stack horizontal tokens={outerStackTokens} styles={outerStackStyles}&gt;
                    &lt;Stack verticalAlign=&quot;start&quot; {...innerStackColumnProps}&gt;
                        &lt;Stack.Item align=&quot;start&quot; &gt;
                            &lt;ActionButton iconProps={addFriendIcon} onClick={this.addButtonClicked} allowDisabledFocus disabled={this.state.sortItems.length &gt;= 10 ? true : false} &gt;Add Item&lt;/ActionButton&gt;
                        &lt;/Stack.Item&gt;
                    &lt;/Stack&gt;
                &lt;/Stack&gt;
            &lt;/div&gt;
        );
    }

    private addButtonClicked(event?: React.MouseEvent&lt;HTMLButtonElement&gt;) {
        let itemsOnAdd = this.state.items;
        let itemTitle = &quot;Item &quot; + (this.state.items.length + 1);
        itemsOnAdd.push({ title: itemTitle });
        this.setState({ items: itemsOnAdd });
    }
}</pre></div>
<p>The post <a href="https://blog.binarybits.net/binding-buttons-in-spfx/">Binding buttons in SPFx</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/binding-buttons-in-spfx/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>React &#8211; Call function from HTML Tag with parameter</title>
		<link>https://blog.binarybits.net/call-react-function-from-html-with-parameter/</link>
					<comments>https://blog.binarybits.net/call-react-function-from-html-with-parameter/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Sun, 26 Apr 2020 08:26:06 +0000</pubDate>
				<category><![CDATA[React]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1236</guid>

					<description><![CDATA[<p>Sometimes we need to call a React function from HTML tags with parameters or arguments and following is the ES6 based way. Here a button is calling a function updateName with argument newName to set a state which in turns changes the name being displayed. Do note that using this.updateName.bind() is the recommended way due [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/call-react-function-from-html-with-parameter/">React &#8211; Call function from HTML Tag with parameter</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><img decoding="async" class="wp-image-1249" style="width: 64px;" src="https://blog.binarybits.net/wp-content/uploads/2020/04/react-logo.svg" alt="React">Sometimes we need to call a React function from HTML tags with parameters or arguments and following is the ES6 based way.</p>



<p class="wp-block-paragraph">Here a button is calling a function <em>updateName</em> with argument <em>newName</em> to set a state which in turns changes the name being displayed. </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">import React, { Component } from 'react';
import { render } from 'react-dom';
import './style.css';

class App extends Component {
  constructor() {
    super();
    this.state = {
      name: 'Kannan'
    };
  }

  updateName = (newName) =&gt;{
    this.setState({
      name: newName
    })
  }

  render() {
    return (
      &lt;div&gt;
        &lt;p&gt;My Name is {this.state.name}.&lt;/p&gt;
        &lt;p&gt;          
          &lt;button onClick={this.updateName.bind(this,'Kannan Balasubramanian')}&gt;Change the name&lt;/button&gt;&lt;br/&gt;
          &lt;button onClick={()=&gt;this.updateName('Kannan Balasubramanian!')}&gt;Change the name again&lt;/button&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    );
  }
}

render(&lt;App /&gt;, document.getElementById('root'));</pre></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Do note that using <em>this.updateName.bind()</em> is the recommended way due to performance and efficiency concerns.</p></blockquote>



<p class="wp-block-paragraph">You can try the sample output <a rel="noreferrer noopener" href="https://kannan-public-react-call-function-from-html-tag.stackblitz.io" target="_blank">here</a>.</p>
<p>The post <a href="https://blog.binarybits.net/call-react-function-from-html-with-parameter/">React &#8211; Call function from HTML Tag with parameter</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/call-react-function-from-html-with-parameter/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get query string parameter using JavaScript</title>
		<link>https://blog.binarybits.net/get-query-string-parameter-using-javascript/</link>
					<comments>https://blog.binarybits.net/get-query-string-parameter-using-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 18 Jul 2017 06:40:39 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Query String]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=924</guid>

					<description><![CDATA[<p>Following code will help in fetching the value of a query string parameter. function GetQueryStringParameter(parameter) { var search = location.search.substring(1); var queryStringParameters = JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&#38;/g, '","').replace(/=/g, '":"') + '"}') return queryStringParameters[parameter]; } Usage: If URL is http://server/page.html?id=1 Then usage would be GetQueryStringParameters(&#8220;id&#8221;) which would return 1</p>
<p>The post <a href="https://blog.binarybits.net/get-query-string-parameter-using-javascript/">Get query string parameter using JavaScript</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Following code will help in fetching the value of a query string parameter.</p>
<pre class="lang:js decode:true " title="Get Query String Parameter">function GetQueryStringParameter(parameter) {
    var search = location.search.substring(1);
    var queryStringParameters = JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&amp;/g, '","').replace(/=/g, '":"') + '"}')
    return queryStringParameters[parameter];
}</pre>
<p>Usage:</p>
<p>If URL is http://server/page.html?id=1</p>
<p>Then usage would be <em>GetQueryStringParameters(&#8220;id&#8221;)</em> which would return <em>1</em></p>
<p>The post <a href="https://blog.binarybits.net/get-query-string-parameter-using-javascript/">Get query string parameter using JavaScript</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/get-query-string-parameter-using-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change new item text in SharePoint</title>
		<link>https://blog.binarybits.net/change-new-item-text-sharepoint/</link>
					<comments>https://blog.binarybits.net/change-new-item-text-sharepoint/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 17 Jul 2017 10:52:31 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[New item]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=916</guid>

					<description><![CDATA[<p>The following script changes the &#8220;new item&#8221; link button in SharePoint view form to whatever we desire. Add either of the script to content editor web part. Plain JavaScript version: (This code assumes that there is only one &#8220;new item&#8221; text in the entire page.) &#60;script&#62; document.addEventListener("DOMContentLoaded", function () { ExecuteOrDelayUntilScriptLoaded(function () { var ReRenderListView_old [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/change-new-item-text-sharepoint/">Change new item text in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The following script changes the &#8220;new item&#8221; link button in SharePoint view form to whatever we desire.</p>
<p>Add either of the script to content editor web part.</p>
<p><strong>Plain JavaScript version: </strong>(This code assumes that there is only one &#8220;new item&#8221; text in the entire page.)</p>
<pre class="lang:xhtml decode:true ">&lt;script&gt;
    document.addEventListener("DOMContentLoaded",
        function () {
            ExecuteOrDelayUntilScriptLoaded(function () {
                var ReRenderListView_old = ReRenderListView
                ReRenderListView = function (b, l, e) {
                    ReRenderListView_old(b, l, e)
                    changeText()
                }
            }, "inplview.js")
            changeText()
        }
    );

    function changeText() {
        var element = document.querySelector('#idHomePageNewItem span:nth-child(2)')
        element ? (element.innerHTML = "Add item") : null
    }

&lt;/script&gt;</pre>
<p><strong>jQuery version: </strong>(This code can replace any number of &#8220;new item&#8221; text)</p>
<pre class="lang:xhtml decode:true">&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"&gt;&lt;/script&gt;

&lt;script&gt;
    $(document).ready(function () {

        var spans = document.getElementsByTagName("span");
        for (var i = 0; i &lt; spans.length; i++) {
            if (spans[i].innerHTML == "new item") {
                spans[i].innerHTML = "add item";
                break;
            }
        }

    });

&lt;/script&gt;</pre>
<p>Source: <a href="https://sharepoint.stackexchange.com/questions/193726/sharepoint-2013-designer-changing-text-of-new-item-for-custom-list" target="_blank">sharepoint.stackexchange.com</a></p>
<p>The post <a href="https://blog.binarybits.net/change-new-item-text-sharepoint/">Change new item text in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/change-new-item-text-sharepoint/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Remove duplicate list items from SharePoint REST call result using JavaScript</title>
		<link>https://blog.binarybits.net/remove-duplicate-list-items-from-sharepoint-rest-call-result-using-javascript/</link>
					<comments>https://blog.binarybits.net/remove-duplicate-list-items-from-sharepoint-rest-call-result-using-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Wed, 17 May 2017 07:31:10 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[CSOM]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=861</guid>

					<description><![CDATA[<p>The following code snippet show how to remove duplicate list items in the JSON result of a SharePoint REST call using JavaScript. Function Definition: function RemoveDuplicateItems(items, propertyName) { var result = []; if (items.length &#62; 0) { $.each(items, function (index, item) { if ($.inArray(item[propertyName], result) == -1) { result.push(item); } }); } return result; } [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/remove-duplicate-list-items-from-sharepoint-rest-call-result-using-javascript/">Remove duplicate list items from SharePoint REST call result using JavaScript</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The following code snippet show how to remove duplicate list items in the JSON result of a SharePoint REST call using JavaScript.</p>
<p><strong>Function Definition:</strong></p>
<pre class="lang:js decode:true ">function RemoveDuplicateItems(items, propertyName) {
    var result = [];
    if (items.length &gt; 0) {
        $.each(items, function (index, item) {
            if ($.inArray(item[propertyName], result) == -1) {
                result.push(item);
            }
        });
    }
    return result;
}</pre>
<p><strong>Function Usage:</strong><br />
In the below code, assumption is that, the REST call returns <em>data.d.results</em> and the column for which duplicate items need to be removed is <em>Title</em></p>
<pre class="lang:js decode:true">var items = data.d.results;
items = RemoveDuplicateItems(items, 'Title');</pre>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/remove-duplicate-list-items-from-sharepoint-rest-call-result-using-javascript/">Remove duplicate list items from SharePoint REST call result using JavaScript</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/remove-duplicate-list-items-from-sharepoint-rest-call-result-using-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Pass multiple parameters in SetTimeout JavaScript Function</title>
		<link>https://blog.binarybits.net/pass-multiple-parameters-in-settimeout-javascript-function/</link>
					<comments>https://blog.binarybits.net/pass-multiple-parameters-in-settimeout-javascript-function/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Wed, 17 May 2017 07:24:11 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=859</guid>

					<description><![CDATA[<p>Following is a code snippet which show how to pass multiple parameters in JavaScript&#8217;s SetTimeout() function. setTimeout(function () { CustomFunction(param1, param2, param3, param4, param5); }, 1000);</p>
<p>The post <a href="https://blog.binarybits.net/pass-multiple-parameters-in-settimeout-javascript-function/">Pass multiple parameters in SetTimeout JavaScript Function</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Following is a code snippet which show how to pass multiple parameters in JavaScript&#8217;s SetTimeout() function.</p>
<pre class="lang:js decode:true ">setTimeout(function () {
    CustomFunction(param1, param2, param3, param4, param5);
}, 1000);</pre>
<p>The post <a href="https://blog.binarybits.net/pass-multiple-parameters-in-settimeout-javascript-function/">Pass multiple parameters in SetTimeout JavaScript Function</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/pass-multiple-parameters-in-settimeout-javascript-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Refresh web part without refreshing page in SharePoint</title>
		<link>https://blog.binarybits.net/refresh-web-part-without-refreshing-page-sharepoint/</link>
					<comments>https://blog.binarybits.net/refresh-web-part-without-refreshing-page-sharepoint/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 16 May 2017 09:34:30 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Refresh]]></category>
		<category><![CDATA[Web Part]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=850</guid>

					<description><![CDATA[<p>The following code shows how to refresh web part without refreshing page in SharePoint. // Set Ajax refresh context var eventAjax = { currentCtx: ctx, csrAjaxRefresh: true }; // Initiate Ajax Refresh on the list AJAXRefreshView(eventAjax, SP.UI.DialogResult.OK); Source: https://pradiprathod.wordpress.com/2015/05/04/how-to-refresh-list-view-in-sharepoint-2013-using-javascript/</p>
<p>The post <a href="https://blog.binarybits.net/refresh-web-part-without-refreshing-page-sharepoint/">Refresh web part without refreshing page in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The following code shows how to refresh web part without refreshing page in SharePoint.</p>
<pre class="lang:js decode:true">// Set Ajax refresh context
var eventAjax = {
    currentCtx: ctx,
    csrAjaxRefresh: true
};
// Initiate Ajax Refresh on the list
AJAXRefreshView(eventAjax, SP.UI.DialogResult.OK);
</pre>
<p>Source: <a href="https://pradiprathod.wordpress.com/2015/05/04/how-to-refresh-list-view-in-sharepoint-2013-using-javascript/" target="_blank" rel="noopener noreferrer">https://pradiprathod.wordpress.com/2015/05/04/how-to-refresh-list-view-in-sharepoint-2013-using-javascript/</a></p>
<p>The post <a href="https://blog.binarybits.net/refresh-web-part-without-refreshing-page-sharepoint/">Refresh web part without refreshing page in SharePoint</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/refresh-web-part-without-refreshing-page-sharepoint/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Load scripts in SharePoint within custom Javascript or Workflow</title>
		<link>https://blog.binarybits.net/load-scripts-sharepoint-within-custom-javascript-workflow/</link>
					<comments>https://blog.binarybits.net/load-scripts-sharepoint-within-custom-javascript-workflow/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Thu, 11 May 2017 05:08:03 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Loading]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=844</guid>

					<description><![CDATA[<p>Following is the code which can be used to load JavaScript in sequence. This code for example loads the reputation.js from SharePoint&#8217;s layouts folder &#38; jQuery from site assets. (function () { ExecuteOrDelayUntilScriptLoaded(function () { //sp.runtime.js has been loaded ExecuteOrDelayUntilScriptLoaded(function () { //sp.js has been loaded SP.SOD.registerSod('reputation.js', SP.Utilities.Utility.getLayoutsPageUrl('reputation.js')); SP.SOD.registerSod('jquery-3.2.1', '../SiteAssets/Scripts/jquery-3.2.1.min.js'); SP.SOD.loadMultiple(['reputation.js', 'jquery-3.2.1'], function () { [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/load-scripts-sharepoint-within-custom-javascript-workflow/">Load scripts in SharePoint within custom Javascript or Workflow</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Following is the code which can be used to load JavaScript in sequence.</p>
<p>This code for example loads the reputation.js from SharePoint&#8217;s layouts folder &amp; jQuery from site assets.</p>
<pre class="lang:js decode:true ">(function () {
    ExecuteOrDelayUntilScriptLoaded(function () {
        //sp.runtime.js has been loaded
        ExecuteOrDelayUntilScriptLoaded(function () {
            //sp.js has been loaded
            SP.SOD.registerSod('reputation.js', SP.Utilities.Utility.getLayoutsPageUrl('reputation.js'));
            SP.SOD.registerSod('jquery-3.2.1', '../SiteAssets/Scripts/jquery-3.2.1.min.js');
            SP.SOD.loadMultiple(['reputation.js', 'jquery-3.2.1'], function () {
                //reputation.js &amp; jquery-3.2.1.min.js have been loaded.
                var context = SP.ClientContext.get_current();
                var web = context.get_web();
                //Check if jQuery has been loaded
                if (typeof jQuery != 'undefined') {
                    console.log("Jquery is loaded");
                }
                else {
                    console.log("Jquery is not loaded!");
                }
            });
        }, "sp.js");
    }, "sp.runtime.js");
})();</pre>
<p>Source: <a href="https://sharepoint.stackexchange.com/questions/92082/uncaught-typeerror-cannot-read-property-get-current-of-undefined" target="_blank" rel="noopener noreferrer">https://sharepoint.stackexchange.com/questions/92082/uncaught-typeerror-cannot-read-property-get-current-of-undefined</a></p>
<p>The post <a href="https://blog.binarybits.net/load-scripts-sharepoint-within-custom-javascript-workflow/">Load scripts in SharePoint within custom Javascript or Workflow</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/load-scripts-sharepoint-within-custom-javascript-workflow/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Setting up Node.js &#038; NPM on a machine without administrative privileges and behind a corporate proxy</title>
		<link>https://blog.binarybits.net/setting-up-node-js-npm-on-a-machine-without-administrative-privileges-and-behind-a-corporate-proxy/</link>
					<comments>https://blog.binarybits.net/setting-up-node-js-npm-on-a-machine-without-administrative-privileges-and-behind-a-corporate-proxy/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Fri, 05 May 2017 07:16:57 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[corporate proxy]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[npm]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=837</guid>

					<description><![CDATA[<p>Recently I was trying to setup a development machine at our office and realized few issues. The machine didn&#8217;t have administrative privileges It was located behind the corporate proxy It uses Windows 10 as primary OS So how to proceed? Following is what I did. [Update: Now node.js includes npm, so I would suggest to download [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/setting-up-node-js-npm-on-a-machine-without-administrative-privileges-and-behind-a-corporate-proxy/">Setting up Node.js &#038; NPM on a machine without administrative privileges and behind a corporate proxy</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I was trying to setup a development machine at our office and realized few issues.</p>
<ol>
<li>The machine didn&#8217;t have administrative privileges</li>
<li>It was located behind the corporate proxy</li>
<li>It uses Windows 10 as primary OS</li>
</ol>
<p>So how to proceed? Following is what I did.</p>
<p><strong>[Update: </strong>Now <em>node.js</em> includes <em>npm</em>, so I would suggest to download only <em>node</em>.<strong>]</strong></p>
<h3>Downloading Node.js &amp; NPM</h3>
<ol>
<li>Download the Node.js binary instead of installer from the below URLs</li>
</ol>
<blockquote><p>Node.js binary (32bit or 64 bit): <a href="https://nodejs.org/en/download/" target="_blank" rel="noopener noreferrer">https://nodejs.org/en/download/</a></p></blockquote>
<ol start="2">
<li><del>Download NPM binary release from the url below</del></li>
</ol>
<blockquote><p><del>NPM Release: <a href="https://github.com/npm/npm/releases" target="_blank" rel="noopener noreferrer">https://github.com/npm/npm/releases</a></del></p></blockquote>
<ol start="3">
<li>Extract Node.js to D:\Development\Node</li>
<li><del>Extract NPM to D:\Development\NPM</del></li>
</ol>
<h3>Set up environment</h3>
<p>Every time the development environment is booted do the following</p>
<ol>
<li>Start a command prompt and set the following path</li>
</ol>
<pre class="wrap:true lang:batch decode:true">set PATH=%PATH%;D:\Development\Node;D:\Development\Node\node_modules\npm\bin;</pre>
<ol start="2">
<li>Check the Node version by typing the following</li>
</ol>
<pre class="wrap:true lang:batch decode:true ">node -v</pre>
<ol start="3">
<li>Check the NPM version by typing the following</li>
</ol>
<pre class="wrap:true lang:batch decode:true ">npm -v</pre>
<p>If you get version numbers for both then both are working.</p>
<ol start="4">
<li>Now set proxy so that NPM can download modules by running the following</li>
</ol>
<pre class="wrap:true lang:batch decode:true ">set http_proxy=http://replace-with-your-organization-proxy-url:optional-port-number
set https_proxy=https://replace-with-your-organization-proxy-url:optional-port-number
npm config set strict-ssl false
npm config set proxy http://replace-with-your-organization-proxy-url:optional-port-number
npm config set https-proxy https://replace-with-your-organization-proxy-url:optional-port-number</pre>
<p>Now the environment is set up.<br />
<em>Do remember, once the console is closed, all the above settings are lost and needs to be run again, just follow the section &#8220;Set up environment&#8221; again or do the following.</em></p>
<p>You can set up the &#8220;path&#8221; variable without administrator privileges in Windows by doing the following.</p>
<ol>
<li>From Windows&#8217;s Start Menu, open Control Panel.</li>
<li>In Control Panel open &#8220;User Accounts&#8221;.</li>
<li>In &#8216;User Accounts&#8221; open &#8220;Change my environment variables&#8221;.</li>
<li>This will open the user&#8217;s &#8220;Environment Variables&#8221; window.</li>
<li>Select the row with entry &#8220;Path&#8221;.</li>
<li>Click &#8220;Edit&#8221; button.</li>
<li>In the &#8220;Variable value:&#8221; text box, append the path of your executable location, which in this case is &#8220;<em>D:\Development\Node;D:\Development\Node\node_modules\npm\bin;</em>&#8220;</li>
<li>Click OK</li>
<li>Open a new terminal or console</li>
<li>Type &#8220;<em>node -v</em>&#8221; to check if node is working fine.</li>
<li>type &#8220;<em>npm -v</em>&#8221; to check if npm is working fine.</li>
</ol>
<p>Source URLs:<br />
<a href="http://abdelraoof.com/blog/2014/11/11/install-nodejs-without-admin-rights" target="_blank" rel="noopener noreferrer">http://abdelraoof.com/blog/2014/11/11/install-nodejs-without-admin-rights</a><br />
<a href="http://www.kscodes.com/misc/how-to-set-path-in-windows-without-admin-rights/" target="_blank" rel="noopener noreferrer">http://www.kscodes.com/misc/how-to-set-path-in-windows-without-admin-rights/</a></p>
<p>The post <a href="https://blog.binarybits.net/setting-up-node-js-npm-on-a-machine-without-administrative-privileges-and-behind-a-corporate-proxy/">Setting up Node.js &#038; NPM on a machine without administrative privileges and behind a corporate proxy</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/setting-up-node-js-npm-on-a-machine-without-administrative-privileges-and-behind-a-corporate-proxy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Copy new appointments from one Outlook calendar to another Outlook calendar using VBA</title>
		<link>https://blog.binarybits.net/copy-new-appointments-one-calendar-another-calendar-using-vba/</link>
					<comments>https://blog.binarybits.net/copy-new-appointments-one-calendar-another-calendar-using-vba/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Wed, 11 Jan 2017 04:51:27 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Copy Appointements]]></category>
		<category><![CDATA[Copy Meetings]]></category>
		<category><![CDATA[Outlook Calendar]]></category>
		<category><![CDATA[VBA]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=788</guid>

					<description><![CDATA[<p>This post talks about a code which can copy new appointnments and meetings from one Microsoft Outlook calendar to another Microsoft Outlook calendar. The code is capable of adding new, updating existing and deleting existing items. One of the issues I was facing while working with my clients was, they had their own email system [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/copy-new-appointments-one-calendar-another-calendar-using-vba/">Copy new appointments from one Outlook calendar to another Outlook calendar using VBA</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This post talks about a code which can copy new appointnments and meetings from one Microsoft Outlook calendar to another Microsoft Outlook calendar.<br />
The code is capable of adding new, updating existing and deleting existing items.</p>
<p>One of the issues I was facing while working with my clients was, they had their own email system and they used to send appointment/meeting requests in those accounts for which I had a separate mail ID. For me it was becoming difficult to track all of them. So I was thinking about a way where all the calendar appointments/meetings across multiple clients get added to my own calendar.</p>
<p>While researching on this, came across a superb post <a href="https://www.slipstick.com/developer/copy-new-appointments-to-another-calendar-using-vba/" target="_blank" rel="noopener">Copy New Appointments to Another Calendar using VBA &#8211; Slipstick Systems</a> and made use of it.</p>
<p>The code in the post works as is except for 2 things which I have listed below.</p>
<ol>
<li>The post uses default calendar as source and I wanted multiple calendar. For this instead of using &#8220;GetDefaultFolder&#8221; I used &#8220;GetFolderPath&#8221;. Do note that each instance of calendar required specific functions to be repeated. (I am planning to optimise this code so that the functions remain same but we can use multiple folders.)</li>
<li>The post&#8217;s delete functionality was not working due to an issue where the delete function was comparing the GUID with starting character as &#8220;[&#8220;, which I had to comment out.</li>
</ol>
<p>Following is the final code which worked for me.<br />
Full credit goes to <a href="https://www.slipstick.com/developer/copy-new-appointments-to-another-calendar-using-vba/" target="_blank" rel="noopener">Diane Poremsky</a></p>
<pre class="lang:vb decode:true " title="https://www.slipstick.com/developer/copy-new-appointments-to-another-calendar-using-vba/" >'Macro to copy calendar items from current default calendar to another calendar
'Source: https://www.slipstick.com/developer/copy-new-appointments-to-another-calendar-using-vba/
Dim WithEvents curCal As Items
Dim WithEvents DeletedItems As Items
Dim newCalFolder As Outlook.folder

Private Sub Application_Startup()
	Dim NS As Outlook.NameSpace
	Set NS = Application.GetNamespace("MAPI")
	' calendar to watch for new items
	Set curCal = NS.GetDefaultFolder(olFolderCalendar).Items 'If you need to use a specific folder then use "NS.GetFolderPath("data-file-name\calendar").Items" and generally "data-file-name" is "user@domain.com"
	' watch deleted folder
	Set DeletedItems = NS.GetDefaultFolder(olFolderDeletedItems).Items 'If you need to use a specific folder then use "NS.GetFolderPath("data-file-name\Deleted Items").Items" and generally "data-file-name" is "user@domain.com"
	' calendar moving copy to
	Set newCalFolder = GetFolderPath("data-file-name\calendar")
	Set NS = Nothing
End Sub

Private Sub curCal_ItemAdd(ByVal Item As Object)
	Dim cAppt As AppointmentItem
	Dim moveCal As AppointmentItem

	' On Error Resume Next

	'remove to make a copy of all items
	If Item.BusyStatus = olBusy Then

		Item.Body = Item.Body &amp; "[" &amp; GetGUID &amp; "]"
		Item.Save

		Set cAppt = Application.CreateItem(olAppointmentItem)

		With cAppt
			.Subject = "Copied: " &amp; Item.Subject
			.Start = Item.Start
			.Duration = Item.Duration
			.Location = Item.Location
			.Body = Item.Body
		End With

		' set the category after it's moved to force EAS to sync changes
		Set moveCal = cAppt.Move(newCalFolder)
		moveCal.Categories = "moved"
		moveCal.Save

	End If
End Sub


Private Sub curCal_ItemChange(ByVal Item As Object)
	Dim cAppt As AppointmentItem
	Dim objAppointment As AppointmentItem

	On Error Resume Next

	' use 2 + the length of the GUID
	strBody = Right(Item.Body, 38)

	For Each objAppointment In newCalFolder.Items
		If InStr(1, objAppointment.Body, strBody) Then
			Set cAppt = objAppointment
		End If
	Next


	With cAppt
		.Subject = "Copied: " &amp; Item.Subject
		.Start = Item.Start
		.Duration = Item.Duration
		.Location = Item.Location
		.Body = Item.Body
		.Save
	End With

End Sub


Private Sub DeletedItems_ItemAdd(ByVal Item As Object)
	' only apply to appointments
	If Item.MessageClass &lt;&gt; "IPM.Appointment" Then Exit Sub
	' if using a category on copied items, this may speed it up.
	If Item.Categories = "moved" Then Exit Sub

	Dim cAppt As AppointmentItem
	Dim objAppointment As AppointmentItem
	Dim strBody As String

	On Error Resume Next

	' use 2 + the length of the GUID
	strBody = Right(Item.Body, 38)
	'If Left(strBody, 1) &lt;&gt; "[" Then Exit Sub 'This particular line didn't work for me

	For Each objAppointment In newCalFolder.Items
		If InStr(1, objAppointment.Body, strBody) Then
			Set cAppt = objAppointment
			cAppt.Delete
		End If
	Next

End Sub


Public Function GetGUID() As String
	GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)
End Function


Function GetFolderPath(ByVal FolderPath As String) As Outlook.folder
	Dim oFolder As Outlook.folder
	Dim FoldersArray As Variant
	Dim i As Integer

	On Error GoTo GetFolderPath_Error
	If Left(FolderPath, 2) = "\\" Then
		FolderPath = Right(FolderPath, Len(FolderPath) - 2)
	End If
	'Convert folderpath to array
	FoldersArray = Split(FolderPath, "\")
	Set oFolder = Application.Session.Folders.Item(FoldersArray(0))
	If Not oFolder Is Nothing Then
		For i = 1 To UBound(FoldersArray, 1)
			Dim SubFolders As Outlook.Folders
			Set SubFolders = oFolder.Folders
			Set oFolder = SubFolders.Item(FoldersArray(i))
			If oFolder Is Nothing Then
				Set GetFolderPath = Nothing
			End If
		Next
	End If
	'Return the oFolder
	Set GetFolderPath = oFolder
	Exit Function

	GetFolderPath_Error:
		Set GetFolderPath = Nothing
		Exit Function
End Function			</pre>
<p>The post <a href="https://blog.binarybits.net/copy-new-appointments-one-calendar-another-calendar-using-vba/">Copy new appointments from one Outlook calendar to another Outlook calendar using VBA</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/copy-new-appointments-one-calendar-another-calendar-using-vba/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-05-28 20:58:40 by W3 Total Cache
-->