Whenever I try and get a number formatter to work in a table view nothing shows up in the column. The number formatter formats the entry as currency. What am I doing wrong?
property theDataSource : null
(* ==== Event Handlers ==== *)
on launched theObject
-- Set up theDataSource so that the rest will be simpler
set theDataSource to make new data source at end of data sources with properties {name:"Owed Money"}
set data source of table view "tableView" of scroll view "scrollView" of window "main" to theDataSource
-- Here we will add the data columns to the data source of the table view
tell theDataSource
make new data column at the end of the data columns with properties {name:"name"}
make new data column at the end of the data columns with properties {name:"amount"}
end tell
tell window "main"
set fmter to formatter of data cell of table column 2 of table view "tableView" of scroll view "scrollView"
-- get:
set fmt to call method "format" of fmter
-- set
call method "setFormat:" of fmter with parameter "0.0"
end tell
end launched
on clicked theObject
if name of theObject is equal to "addEntry" then
-- Add a new contact
set theRow to make new data row at the end of the data rows of theDataSource
tell window "main"
set contents of data cell "name" of theRow to "Hello"
set contents of data cell "amount" of theRow to "5.5"
end tell