start cell editor immediately on all cells - ag-grid

I am searching for a solution to how I can start an ag-grid table with only cell editors. That means I do not want to click into the row or cell to edit the data.
I have found almost a solution for me with this example in the doc:
Full row editing
This is exactly what I am searching for. I can programmatically start editing immediately. The problem with that example is that onCellValueChanged is only fired after the keyboard click "enter" or click on the next row.
I would need a solution where onCellValueChanged is fired immediately after a cell changed.

I can think of two ideas to accomplish this:
Use "No Click Editing"
This is similar to having all cells contain an input box. It just takes 1 click to focus.
https://www.ag-grid.com/javascript-grid-cell-editing/#no-click-editing
Custom cell renderer
Use a custom cell renderer to have input boxes in each cell. Then, you are always in edit mode. And you can control when the value is saved.
https://www.ag-grid.com/javascript-grid-cell-rendering-components/

Related

ag-grid popup cellEditor - how to prevent close on click?

I have an ag-grid popup cellEditor which contains an angular mat-select control. Is there a way to prevent the popup cell editor default behavior of closing on a click outside the cell? When an item is selected the ag-grid popup cellEditor closes. I believe this is due to the click on the select drop down being interpreted as outside the cell. Is it possible to prevent popup cell closure for this case or even in all cases such that I can control it completely via code using gridApi.stopEditing()?
See https://material.angular.io/components/select/overview for information on the select control. I am not including full details here as it is likely not important.
Image of popup editor, You can see how cell is before editor is invoked as well. See where the blue number one appears

Nattable - ButtonPainter on cell is going on edit mode on click ,

i am trying to follow class Rendereing_a_cell_as_a_button
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/Rendering_cells_as_a_link_and_button.java
from Nattable example to create similar button , i have copied same example code.
Button is showing on the desired column, but on click the style is not getting change of button like clicked and also listener is not getting called, it is going to edit mode and showing the content of cell.
Before Click
After click
If your table also supports editing you need to ensure that cells in the column that shows buttons should be not editable. This can be done by registering an IEditableRule#NEVER_EDITABLE for that column.

XCode/Swift OSX. Select and Edit Cells in ViewBased NSTableView

Before I ask my OSX related question please allow me to describe a feature in MS Windows.
If I create a Windows application in MS Visual Studio where the application contains a simple DataGrid the user can simply click into a cell, edit the contents and use the keyboard up/down arrow keys to move quickly out of the cell to the next one. keying out of the cell triggers the EndEdit event. Using the up/down arrow keys like that a user can quickly move down a column editing values without pressing Enter or using the mouse.
I'm trying to do the same with OSX XCode/Swift. Using the mouse to click into a cell and edit is no problem. But it seems as though I have to click the cell twice to get it selected for editing and then after editing I have to press enter or click another cell. I can't simply use the up/down arrow keys to key out of the cell.
Is that simply the way OSX works? I mean I'm making an OSX application so I want it to behave like a native application but it just seems like a lot of entering and clicking is required if, for example, the user was going to edit a few cells.
Are there any properties I need to set in the ViewBased TableView?
Sorry about the long email - I hope I've explained it though.
Thanks
Ian
After much head scratching I've got something that appears to work exactly as I want.
myTableView is on an NSViewController.
In the NSViewController's viewDidLoad() I've got this:
super.viewDidLoad();
NSEvent.addLocalMonitorForEventsMatchingMask(NSEventMask.KeyDownMask, handler:{
(event: NSEvent) in
self.myTableView.keyDown(event);
switch(event.keyCode)
{
case 36:
return nil;
case 125:
return nil;
case 126:
return nil;
default:
return event;
}
})
I have to confess I'm not 100% sure but my thoughts were that the default behavior of the tableView is for the up/down arrow keys to move the row selection up or down a row but that doesn't happen when a cell is being edited. When the text cell has edit focus the up/down keys simply shift the cursor to the start/end of the cell (ie move the cursor within the cell). Not the behavior I want so I thought if I could swallow (make nil) those events within the cell then the arrow keypress would bubble up to the tableview and it would do the up/down row select - if you see what I mean.
Anyway - no matter where my thoughts were - this does seem to work exactly as I want and when the edit focus arrives on the next cell it gets instant edit focus. Basically working just like it does in programs such as excel and numbers etc.

A way to know if only one cell is selected or an entire row is selected in a Ext Js 4.2.2 grid

I'm pretty new to Ext Js 4.
My question is "is there a way to know (a method or something) if a row is selected or just one cell is selected in a Ext Js 4.2.2 grid?"
I need to run some code if there is only one cell selected and run totally different code if the entire row is selected.
Also I need to change the type of selection in that grid, I mean if I press click on a cell, the entire row gets selected, but if I press double click on a cell, only that cell is selected.
I have no idea how to do that, so I would appreciate any kind of help.
So what I really need to do is to copy to the clipboard the content of the cell (if there is only one cell selected) or the content of the row (if the entire row is selected) and permit to the user to switch the selection mode from cell selection to row selection by clicking or double clicking one cell. I already know I have to use CTRL C in a hidden 'textarea' where the text is already selected in order to achieve the copy to the clipboard.
Many thanks!
You can use celldblclick for double click on cell and itemclick for click on record. If you click on record that record will be selected automatically if disableSelection is false.
You can add listeners to these events to do your own logic.
celldblclick is available since version 4.1.0
itemclick is available since version 4.0.0
--Sridhar

UITableView form

I am having very annoying issue. I have one form page with 5 custom cells. Each of them has one text field. On the bottom I have one button. In an onclick button function I am gathering values from each of the 5 described text fields.
My problem is that if my keyboard is up, I will get the values of not all but just visible text fields, the ones I don't see are null.
How to override this?
Thx,
Mladen
Separate data you have from your interface, that is store your textfield values in some other place right after you finish input. And access your data there.
UI elements are not intended to store data, but just to display it and allow input - as you can see in your case if you do not see a particular element you cannot be sure that it actually exists.
This might solve your problem..
1. Register your viewcontroller for KeboardNotifications
2.When keyboard will appear resize the view so that all fields will be visible.
3. When keboard will disappear just resize it back and continue..