I have a uitable with a checkbox column.
I want to toggle the checkbox status for each selected cell. Clearly, that does not work when the callback function executes when the user is still adding cells to the selection.
It should rather execute not earlier than the user releases the mouse.
The normal behaviour of a cell selection callback function however fires every time the selection area canges.
How can one change this behaviour?
A
Related
I have a Window with multiple NSTableView elements where I can select rows.
Now when I press a button an action is triggered and I need to do stuff depending on which element in which NSTableView was selected before the click.
How do I do this?
I can check using the selectedRowIndexes but this is set for all tableViews that has selected items and not only for the one that the user wants the action for. (the last one that was selected)
my react grid has a some row values that depends on state (Actually has a slider column).
But i need to show new slider value after state changed by slider. I did it by call redrawRows() because refreshCells() is not changing cell value as state. refreshcells is does nothing into slider.
redrawRows working good but losing mousedown event on slider. i changing slider value with mouse and slider's mousedown handling is lost after redrawRows. I must re press mouse button on every slider value change
Why refreshCells does not update cell value?
For the refreshCells to work, your slider cell renderer component should implement refresh() method.
As per the docs -
To handle refresh, implement logic inside the refresh() method inside
your component and return true. If you do not want to handle refresh,
just return false from the refresh method (which will tell the grid
you do not handle refresh and your component will be destroyed and
recreated if the underlying data changes).
Refresh Cells: api.refreshCells(cellRefreshParams) - Gets the grid to
refresh all cells. Change detection will be used to refresh only cells
who's display cell values are out of sync with the actual value. If
using a cellRenderer with a refresh method, the refresh method will
get called.
In your case, it may be possible that the refresh method is not being called.
Please read more on cell renderer component life cycle here
My table view is set up such that pressing "edit" creates an insert row using UITableViewCellEditingStyleInsert. The cell reads "add new item" and has a green plus next to it.
When the user taps the green plus, a modal view controller pops up so they can add a new item. This is fine. But it only works if they press the green plus itself - not the "add new item" cell.
How can I make it so that pressing the cell itself will do the same as the green plus?
Thanks!
You can; you just have to handle the selection yourself. First set allowsSelectionDuringEditing = YES, as shown above, then in the delegate's didSelectRowAtIndexPath: method, check to see if the selected row is the last row (or whatever row has your plus icon). If it is, run the same code you do in the didCommitEditingStyle: method.
I think ,Not possible because the entire edit mode process of UITableView is controlled by iOS (done by private API's) not exposed to us. we do have delegated (UITableViewDelegate) functions but not sufficient to get your work done.
Although, we can show the selection on the table Cell while in edit mode.
#property(nonatomic) BOOL allowsSelectionDuringEditing
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableView_Class/Reference/Reference.html
I have a UIPickerView with two components.
It works fine when the user scrolls each component until it reaches the desired value.
But I want it to behave like the picker in the calendar or the clock apps. Meaning: When the user presses a certain value in one of the components, I want that component to automatically turn that row to be the selected row (so the user doesn't always have to scroll, he/she can also simply select the value they want).
Does anyone know how to do that?
Thank you,
~Chonch
It is standard picker behaviour and it should work so automatically.
If your picker does not select tapped row automatically try to set userInteractionEnabled property to NO for the view you return from viewForRow: method in picker data source.
I am currently using a UIPIckerView in my app to allow a user to select from a list of options. The problem is that there isn't enough of a delay when the user stops spinning the wheel and it is selecting a value before the user has a chance to scroll further down the list.
Is there a way to override the default behavior that selects the row as soon as the wheel stops spinning and the user removes their finger? I see Mobile Safari includes a "Done" button which would be great.
I can provide code if necessary (not sure how it would help).
Thanks!
You can add this manually; just add a done button to the view that holds the UIPicker, and have IT do whatever action you're currently performing in – pickerView:didSelectRow:inComponent:.
The UIPickerView automatically selects which ever row stops in the center. It does not work like a table but more like a popup menu. As such, you can't use a picker view like a button to call an action because it will trigger the moment the user stops moving it whether that represents their final choice or not.
Instead, as noted previously, you need a second control element (usually a button) to call the action that makes use of the pickerview's selection.