Press "Enter" to skip to content

Posts tagged as “Javascript”

Using ReactJs in K2 (Masonry Layout)

2

I have been a fan of ReactJs for some time so far. I like the idea, that, as well as in K2, you can also create reusable components, even though the framework allows more customizations. K2 cannot be used to build single page applications, but nobody said it is not allowed to use ReactJs to create nice UI or layouts. In this post I will show you, how you can use ReactJs to build a masonry layout for images, stored in a SmartObject. The ReactJs component will get the images from K2 and render them in a nice responsive way. By the way, the approach is also suitable for K2 Cloud, where you cannot install any custom controls.

How to make Textarea resizable in K2

0

By default Textareas have static width and height. But with a piece of code you can make it resizable. Please, refer to the post How to add JavaScript on Smartforms, if you need a more detailed description. In this post I will provide only some tiny demo and a piece of external code to add onto your Smartforms. And here is the final result, that you will achieve by adding the code below:

K2 Slide In Worklist

1

Recently at the customer I have been challenged with an interesting requirement, i.e. to have a slide in worklist in K2. The idea is to have it available on any form and somehow to indicate, that a user has some new tasks. I decided to create a reusable view, which you can add to any form you want and which will do the trick. For this you will need CSS and JavaScript. Therefore, please, refer to the article How to add JavaScript on Smartforms, if you do not know, how to do that.

Turn your tabs into a ‘hamburger’ menu

0

Below you can find a piece of code, which can be used to turn the standard Tabs menu into a hamburger one when you open the form on a mobile device, i.e. the maximum screen width is 800px. The code consists of 2 blocks, which need to be placed on the form. Please, refer to the following article on How to add JavaScript on Smartforms, if you have any question. The current approached was tested by me on K2 Cloud and it works.

Using K2 with NoSQL (MongoDB + dynamic REST API)

0

Such scenarios are not common, that you need to use K2 with NoSQL databases. However, I would still like to show the possibility of a K2 platform to connect to NoSQL databases to 'CRUD' data. Moreover, the REST API I am trying to show is kind of dynamic. The object schema as well as the collection you are working with completely depends on the swagger schema you use with K2 REST Broker. The current approach is also suitable for a K2 Cloud platform.

Changing view background in K2 Smartforms

1

Changing a view background in K2 Smartforms is not available out of the box. Moreover, if you need to create a reusable component with the new background, which you can then reuse across one or multiple applications. Here I will quickly explain, how you can change view background in K2 Smartforms with the help of JavaScript. Please, refer to the post How to add JavaScript on Smartforms, if certain steps are not clear.

How to find a control instance with JavaScript

0

Very often people try to find a control instance with JavaScript in K2 Smartforms. The approach, discussed in this article, can be used to find certain controls. However, this is not something you need on a daily basis, but rather rarely for certain functionality, that is not available out of the box. When you need to inject something and need to set or get the value of a control.

Scroll to top button

2

Various preferences of customers define the layout of their forms. Some prefer the forms with tabs, others – everything on one page. Quite often you can have big forms and…