Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Change the css class with the mapping result

Ok, Sergiy!

I got it! Very simple solution.

I moved the javascript code to on_success mapping code instead of use it in html code.

code
"source": "$['body'][0]['_id']",
"target_transformation": function(value) {
if (value == "55600a7fe4b0f840f328ab8f") {
$( '#product_wishlist_bt' ).removeClass( 'product-bookmark' );
$( '#product_wishlist_bt' ).addClass( 'product-bookmarked' );
console.log("bookmarked");
}
},
"target": "$['wishlist_status:text']"
/code

Return to “Issues”