Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

implement accounting.js Oracle APEX

Dj SteeleSep 27 2018 — edited Oct 1 2018

GoodAfternoon Community,

Good Afternoon Community

I am using APEX 5.1.0.00.45 with Oracle 12c Database utilizing PL/SQL Developer and SQL Developer

--------------------------------------------------------------------------------------------------------------------------------------------------------

I am looking to Format a Column in an Interactive Grid and came across this weblink: Accounting.js http://openexchangerates.github.io/accounting.js/#download

Can this be Implemented into APEX through Shared Components ----> Static Application Files & Placing <script> in HTML Header of Page ???

If so Could someone Elaborate on Exactly How to Implement this

What I'm Looking to do is to get Column "EXTENDED_PRICE" Formatted with comma as thousands separator & 2 digit decimal which I know you can use .toFixed(2);

Screenshots Below

Column Looking to Format NOTE: the last row in the Column is Formatted Because of a Submit Page ; When it comes back to the Page its Formatted ( I'm looking to Format it before Submit Page or On The Fly)

pastedImage_3.png

JavaScript that is Calculating the EXTENDED_PRICE

var $te = $(this.triggeringElement); //Qty

//Get the ID of the row

var rowId = $te.closest('tr').data('id');//Qty

Identify the particular interactive grid

var ig$ = apex.region("grdRcptLog").widget(); //RECEIPT LINES GRID

//Fetch the model for the interactive grid

var model = ig$.interactiveGrid("getViews","grid").model; //RECEIPT LINES MODEL

//Fetch the record for the particular rowId

var record = model.getRecord(rowId);

var thisrowItemCst = model.getValue(record,"ITEM_COST"); // is the Non-Triggering Element

var thisrowItemQty = this.triggeringElement.value; //ITEM_QTY COLUMN is the Triggering Element

//alert(thisrowItemQty);

if ( thisrowItemQty >= 0 ) { //this.triggeringElement.value;

    // We have a valid number. Let's do this.

    ExtendedPrice = thisrowItemQty \* thisrowItemCst;

    model.setValue(record,"EXTENDED\_PRICE", ExtendedPrice.toFixed(2));

     }

Best Regards,

DSteele41

This post has been answered by J-Lig on Sep 28 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2018
Added on Sep 27 2018
4 comments
891 views