Cannot order by a template field in the table component

  • 2
  • Problem
  • Updated 4 years ago
  • Solved
  • (Edited)
Hi,

My products have the internet speed on it which is setted in two fields: quantity and unit (to make 100MB, 90Kb,...) and I have a formula field with the speed in bytes calculated. Something like this:

Quantity    Unit           bytes
   100          Mb       100000000
     90          kb           90000

In the table I have created a template field with {{Quantity}}{{Unit}} with allow ordering true and Order Field 'bytes'

But in the table the ^v Arrows does not appear in the column to order.
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Something to check: can you go in to the JavaScript Console ("Command+Shift+J" in Chrome), and enter the following:

var BF = skuid.$M('Products').getField('Bytes__c');console.log('Display Type: ' + BF.displaytype + ', Sortable: ' + BF.sortable);

replacing Products with the name of your Products model and Bytes__c with the API name of your Bytes formula field.

Let us know what this returns. 
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb
... My fault... The Bytes field wasn't in the model.... sorry...
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Doh.. I've done that so many times its not funny.

Thanks for letting us know you got things fixed though.