For support issues please visit https://jira.deiser.com/support

Page tree
Skip to end of metadata
Go to start of metadata

It is possible to execute scripts on Project Fields Tab, on view and edit screen. There is an option in Profields Schemes screen to do that.

 

That way you can customize your own Project Fields Tab to adapt it to your design, interacting with all screen elements. It is very simple to use, but very powerful. Scripts may be as complex as you need.

 

If you want to execute a script on the view screen of the Project Fields Tab you may call profields.onEdit function with your function as parameter. A example could be:

profields.onView(function(){
    //your code would be here
});

On the other hand, if you want to execute a script on the view screen of the Project Fields Tab you may call profields.onEdit function with your function as parameter. A example could be:

profields.onEdit(function(){
    //your code would be here
});

 

 

 

Example1

We have developed a simple example to change the design of view and edit Project Fields Tab. Here we can see the code:

 

profields.onView(function(){
    AJS.$('.profields_view_url').css('font-weight','bold');
    AJS.$('.profields_viewmode_cumulativeIssuesfields').css('color','red');
    AJS.$('.profields_viewMode_list').css('text-decoration','underline');
    AJS.$('.profields_viewMode').css('background-color','yellow');
});

profields.onEdit(function(){
     AJS.$('.profields_title').css('font-weight','bold').css('background-color','black').css('color','white');
});

 

This is the view screen of Project Fields Tab:

 

And this is the edit screen of Project Fields Tab:

 

 

Example 2

We have developed a simple example to set the format Zip for Spain (five numeric characters).

(The user can only enter into the field five numeric characters).

 

Here we can see the code:

var TEXTFIELD_ID = 6
profields.onEdit(function () {
   profields.getValueElement(TEXTFIELD_ID).keydown(function (e) {
      var controlCodes = [46, 37, 39, 9, 8, 13],
         unicode = e.keyCode || e.which || e.charCode;
      if (controlCodes.indexOf(unicode) === -1) {
         if (this.value.length > 4) return e.preventDefault();
         if ((unicode < 48 || unicode > 57) && (unicode < 96 || unicode > 105)) return e.preventDefault();
      }
   });
});

 

This is the edit screen of Project Fields Tab:

With that example you can realize that the customization possibilities to adapt our Project Fields Tab for your own purpose are infinite.

 

  • No labels