Example of jsTree with different context menu for different node type

Submitted by Asif Nowaj, Last Modified on 2019-11-08

If you are wondering on how to let jsTree show different context menu for different nodes, you are at the right place. Context menu appears when a user right-click on a node. Probably you already have seen on how to show a customise context menu on jsTree's node right click. if not please have a quick look at jsTree with Custom Context Menuthen come back here to see how you can show different right click menu based on different condition.

For example, if you want to allow your users to delete "files" but not "folders" (by hiding the "delete" option from the context menu for folders) or to show Create new file, create new folder option for folders but not for files, please see the example below.

In this example, you will also be able see how you can use different icons for different nodes and different nodes for leaf nodes.

Example of jsTree with lazy loading and AJAX call

Submitted by Asif Nowaj, Last Modified on 2019-11-08

When you tree data grows large and large enough that loading whole tree data is too much heavy and time consuming, then your best choice would be to use lazy load. Lazy loading means only immediate child nodes will be loaded on the fly whenever user clicks on a node that has children.

In this scenario, jsTree will perform the ajax requests as user browses the tree. Below example will depict lazy loading with jsTree and AJAX call. You can go through this example to understand how dynamically loads data with ajax call. In this example, an existing data source URL has been used from jsTree but you can use your own WebAPI or MVC url to get the data securely.

SQl Server / AWS RDS - How to remove a cached query plan - High CPU issue

Submitted by Asif Nowaj, Last Modified on 2019-11-08

Recently, an issue was experienced where AWS RDS SQL server was consuming 100% CPU throughout the day. CPU capacity was really high hence it was quite unexpected. Upon investigation, it was found that there was a particular query was taking huge CPU during execution. But surprisingly, when the query was executed from SQL management studio, it was running fine, even it was executing within a second.

Please see below how to investigate high CPU usage issue for AWS RDS. This could be applicable for standalone SQL Server too.

How to free up space in local disk C on your PC or laptop

Submitted by Asif Nowaj, Last Modified on 2019-11-08

There are many ways you can clean up hard disk space from your PC or laptop. It is a very common problem when your laptop or PC goes out of space and behave weirdly. When your disk, especially your Operating System (OS) drive that C: drive is running out of space, then the symptom will appear as differently with your other works. Hence, first check your OS drive space if your email client is not responding, your computer's performance is degraded, starting of your laptop is taking too much time, your game play is lagging.

If you see that your OS drive space is less and you need to clear out some of your important files to get some more space, request to follow these steps before taking any action.

How to merge SVN branch from trunk

Submitted by Asif Nowaj, Last Modified on 2019-11-08

In general, any change which is required to mitigate any priority issue in production, is done directly in trunk at times. At same time, development team is continue to work in separate branches. Hence a time comes when any changes which is made directly in trunk is merged with branches to get it tested.

Below are the steps that can be followed if you want to merge trunk version of code into your branch.


How to create SVN branch from trunk

Submitted by Asif Nowaj, Last Modified on 2019-11-08

SVN Trunk code should always be the production copy of the codebase. At least this is how I see it.

When a new project work starts an existing application or required a significant amount of code change then you might need to create a separate branch from working production copy of the code. Apart from that, there could be many other reasons to create separate SVN branch from trunk like multiple team, parallel work etc.

jsTree - background colour

Submitted by Asif Nowaj, Last Modified on 2019-11-08

If you want to change the background colour of selected node of your jsTree or changing background colour of whole tree then you can go through this example of changing background colour of jstree. It will allow to change the background colour by applying custom css to jsTree and its nodes. Also, it will give you an idea how to change the background color of jstree or change the background colour of a selected node programmatically.

jsTree - document.registerElement is deprecated

Submitted by Asif Nowaj, Last Modified on 2019-11-08

If you are using jsTree library and found out that Chrome has started to warn about deprecating a feature used by jstree like below. Then you can find what you need to do to resolve this issue (warning).

document.registerElement is deprecated and will be removed in M73, around March 2019.
Please use window.customElements.define instead. 
See https://www.chromestatus.com/features/4642138092470272 for more details.

Example of simple jsTree with unique node name

Submitted by Asif Nowaj, Last Modified on 2019-11-08

jsTree is jquery plugin, that provides interactive trees. jsTree is easily extendable, themable and configurable. One of noticeable feature is its unique node name. This plugin enforces that no nodes with the same name can coexist as siblings. This plugin has no options, it just prevents renaming and moving nodes to a parent, which already contains a node with the same name.


Subscribe to everyEthing RSS