Thanks for all the help in the past.
I have a table with several columns, the first column of which contains check boxes. I would like to be able to click the check box in any row to change its state but without selecting the row. (It’s not a problem if the row has previously been selected.) I think I can use the should select row handler to inhibit selection, but I cannot figure out how to determine if the cell (or column) with check boxes has been clicked.
Any help appreciated.
Hi Doug,
maybe you could use ‘on should select row’ to store the last state of selection in a global and restore the selection from this value in your table view’s ‘on cell value changed theObject row theRow table column tableColumn value theValue’ in case the changed cell’s table column is the one with the checkboxes?
Hope that helps,
Dominik
Edit: It might be better to store the last selection in an on clicked handler …
Thanks, Dominik. You got me thinking.
The column I refer to is a column of checkboxes. What I did was determind the xPos of the mouse click with call method “mouseLocationOutsideOfEventStream” of window “mainWindow”. If the click was within the width of the column, no select the row. However, the checkbox would still be toggle-able.
But NOW I have another related challenge.
Is there ANY way of preventing my checkbox column from being moved (re-ordered) while still allowing other columns to be re-orderd? Ideally, I’d like it locked in to place as the first column in the table view. I suspect I may have to subclass it, but I’m just not sure how to do it.
Suggestions most appreciated as always.
Got it. This prevents any column from being moved to the first column by moving it back to its position before the move:
on column moved theObject new column newColumn old column oldColumn
if newColumn is 0 then
call method "moveColumn:toColumn:" of (table view 1 of scroll view 1 of window 1) with parameters {newColumn, oldColumn}
end if
end column moved