logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Wednesday, June 16, 2021 9:01:20 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
I'm populating an element with a currency value via javascript. Is there a way to make js use the [UIHint("lc"] decorator? Or do you have to do it manually since you're in js and not MVC?

Or do you already have a helper method to format decimals to currency in js?

Code:

    function grdReturableItems_Edit(e) {
        var editForm = e.container;
        var model = e.model;

        editForm.find("#lblPrice").text(model.Price);
    }

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Wednesday, June 16, 2021 9:04:31 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
You have to do it manually. There is no javascript helper method in AC.

Thanks.
Joe Payne2  
#3 Posted : Wednesday, June 16, 2021 2:55:07 PM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
Ok is there an example of how Able does it somewhere you could point me to please?
shaharyar  
#4 Posted : Thursday, June 17, 2021 1:29:37 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
There is an example in admin - manage - Payments list page

Search this line in Website\Areas\Admin\Views\Payments\Index.cshtml

Code:
return total.toFixed(2);


The function is used to update the Capture total amount on a button. The text on button will be updated upon list checkbox selections.

Please visit Admin - Manage - Payments page and try to select the payments in the list and see the Catpure button text changing.
Joe Payne2  
#5 Posted : Thursday, June 17, 2021 5:49:56 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
Worked perfectly, thanks so much!

Sorry I know that was probably a really, really simple question. This javascript stuff is really hard for me. I've gotten so used to C# IntelliSense showing me available methods on an object. When I need to do something in javascript, I don't even know what to search for in Able to find a working example. I appreciate the help.
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.