How to get sum of two columns in another column in grid. Added a demo grid in my workspace 'FX_WS_2142' and application ID '601'. Need to add basic salary and allowance column values and derive total salary in the grid while creating/updating the record.

Looking forward for the solution. Thanks in advance.

Regards, Nazeer

asked 13 Apr, 01:24

Nazeer's gravatar image

accept rate: 0%

Thank you for the test case, much appreciated.

We have updated your test case with a working example. To achieve your requirement we need to use the "FOEX Grid Set Column Value on Column Change" action which will update your "total salary" column when the "basic" or "allowance" values change.

You need to setup your actions to listen to the "FOEX Grid - Before Edit" event. e.g.

alt text

alt text

alt text

To explain the javascript expression in use and the variable names "newValue" and "record" they are made available to you which you can see in the help text e.g.

alt text

And here is the result

alt text


answered 13 Apr, 02:57

FOEX-SUPPORT's gravatar image

accept rate: 32%

edited 13 Apr, 03:00

Thank you... It works fine...

(13 Apr, 03:17) Nazeer Nazeer's gravatar image

To get decimal numbers, we need to use parseFloat instead of parseInt like below.

(parseFloat(newValue, 10) + parseFloat(record.get('ALOW_SAL'), 10))

I added this just to help others, what i found when i tried with decimals.


answered 18 Apr, 02:41

Nazeer's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 13 Apr, 01:24

Seen: 320 times

Last updated: 02 Oct, 07:44

FOEX Links