May 05, 2009, 11:28 AM
Sort with Conditional sort direction in JS- help!
I need to conditionally set the sort direction of the below, but keep getting a syntax error:
#{storeContracts}.sort(#{cbSortBy}.getValue(),'DESC');
Needs to be something like:#{storeContracts}.sort(#{cbSortBy}.getValue(),if (#{cbSortBy}.getValue() == 'totalCharge'){ 'ASC'}else{ 'DESC'});