If the grid has Selection and Updating, setting the startEditTriggers doesn't work. Only double-clicking will work to initiate edit mode. Click or F2 will not.
grid.igGrid( { columns: buildColumns(), features: [ { name: "Sorting", type: "local" }, { name: "Selection", mode: "cell", multipleSelection: false, activation: true, cellSelectionChanged: function (evt, ui) { var actualRowIdx = ui.cell.row[0].rowIndex - 1 // rowIndex is not zero based (and varies both on naming standard and zero-base depending on which event is being used [good times indeed]), but methods expect a zero-based index if (ui.cell.columnKey === 'NextRound') { var myCell = grid.igGridSelection('getCellValue', actualRowIdx, 'NextRound'); var dataview = grid.data('igGrid').dataSource.dataView(); var myVal = dataview[actualRowIdx]["NextRound"]; grid.igGridUpdating("setCellValue", actualRowIdx, 'NextRound', !(myVal)); dataview[actualRowIdx]["NextRound"] = !(myVal); grid.igGridSelection('deselectCell', actualRowIdx, ui.cell.index); grid.igGridUpdating('endEdit'); grid.igGridSelection("clearSelection"); } else { // grid.igGridSelection('selectCell', actualRowIdx, ui.cell.index ); grid.igGridUpdating('startEdit', actualRowIdx, ui.cell.index); } } }, { name: 'Updating', editMode: 'cell', enableAddRow: false, enableDeleteRow: false, validation: true, startEditTriggers: 'click,dblclick,enter', editCellEnded: function (evt, ui) { //NOTE: editCellEnded likes attention, it also likes to fire when entering edit mode on a cell }, editCellEnding: function (evt, ui) { //TODO: check valid value (number, not used previously, not more than # of competitors) & return false with alert if not ok if(ui.value!='' && isNaN(ui.value)){ alert('Not a valid scoring number'); //evt.stopPropagation(); evt.stopImmediatePropagation(); evt.preventDefault(); return false; //NOTE: see the mighty "editCellEnding" in action, its event propagation is unstoppable
} } }], width: "100%", dataSource: CompetitionRound.RoundCompetitors, autoGenerateColumns: false, renderCheckboxes: true });
Hi,
First you didn't define F2 in startEditTriggers so it is normal not to work.
When you define 'click' and 'dblclick' at the same time only the 'dblclick' works. I believe this is by design, because I couldn't find bug on the subject and this behavior dates back in 11.1.
When you use Updating and Selection together and you have defined 'click' as startEditTrigger you first need one click to make the selection and then you need second click to start editing. This is by design.
Hope this helps,
Martin Pavlov
Infragistics, Inc.
I should've wrote that I tried each individually as well. Neither click or F2 works by themselves, and enter by itself results in the selected row dropping one down and then entering edit mode. Sorry I wasn't more clear initially.
So Selection overrides the single-click option by design? Looking at KendoUI, Telerik's RADGrid, jqGrid and quite a few others (especially lately given that I can't go a solid day using igGrid without running into a major issue), I haven't found any grid that behaves like that. If I turn "click" on, I should be able to click to select the row (if I have row specified) and enter edit mode on the cell selected automatically - click to edit should obviously override selection. Surely clicking then clicking again can't possibly be by design, that would be crazy. I had thought it was just a poor result of having different developers work in silo's for each behavior as someone from Infragistics commented on recently in the forum regarding the different naming conventions used in each separate behavior (Selection, Updating, Sorting, etc...). It seems like the different behaviors don't really take each other into account.
Can you provide any sort of hint where Infragistics is going with the jQuery igGrid? I'm at my wit's end with all the problems I've been facing - aside from the few days I took off, multiple tickets have been opened relating to issues I've reported, as well as explanations that what should be common (and is in other competing grids) simply isn't in igGrid. Things like header styling (differing justifications, etc...), events misfiring or unable to be canceled, hidden columns throwing multiple things off, having to click 3 times to check a checkbox (again because behaviors don't cooperate), inability to enter edit mode easily/reliably, keyboard navigation not working, etc... In addition to needing to wrap up what should have been a quick piece of a project, I need to decide whether sticking with it is feasible or if I need to move to another grid/company. It seems like the most recent releases have been feature oriented rather than stability or documentation improvements, and those features don't always work well together (regression tested?). I've been with Infragistics for well over 10 years, but the last couple have been staggeringly difficult to endure.
Hello from me,
We have a solution for single click editing and updating with checkbox.
Please use the following code:
I would have assumed "click" would have overrode "dblclick", regardless though, simply putting "click", or "enter" or "F2" all fail. "enter" fails oddly by moving the selection to the next row and placing the cell under the one that had focus into edit mode rather than the focused cell.
I will say again: "click" even by itself, fails.
Regarding the checkbox, yes I understand what you're saying, but the logic behind that way of thinking is obviously wrong and the explanation just seems to justify a poor design, poor user experience, poor use cases, poor planning. I'd suggest you check out some competing products or even the old UltraWebGrid. It's universally understood that clicking a checkbox should check it. The igGrid is the only place I've ever seen where you have to click through 3 clicks to get it checked and if you tried to explain it as needing 3 clicks to any end user they'd think you were crazy. 2 clicks without selection is still ridiculous. What may be worse is the defense of it as supposedly logical and normal - and something I should expect elsewhere. Even your own WebDataGrid checkbox sample ( https://es.infragistics.com/samples/aspnet/data-grid/unbound-checkbox-column ) only requires a single click to check it - if the logic you related was valid I would have expected the WebDataGrid to adhere to it as well.In that sample, I had tried a myriad of ways to get the event canceled and have the cell in question remain selected and in edit mode. Those were just left in place while I researched other outstanding and crippling shortcomings of the igGrid. Simply returning false doesn't stop the focus from moving to the next cell or exiting edit mode.
Hi revbones,
The description of startEditTriggers did not include notes that if "dblclick" is included in triggers, then "click" has no effect.Logic of updating assumes that is application included "dblclick", then possible "click", which might remain from default setting, should be ignored. The description of that option was adjusted for that rule.If your application needs to start edit mode on a single click and on F2, then I suggest you to set value of that option to "click,F2".
If both selection and updating are enabled, then editing can be started on for already selected cell/row. If editing would be started on first click over unselected cell, then it would be impossible only to select cell without start editing. End user would not be able to just navigate selection through cells of grid.That means that editing can be started only by 2nd click on the same cell.
The checkbox cell editor is exactly the same as all other cell editors. Its value can be modified only when it gets focus. Therefore, in order to toggle checkbox, end user should click 3 times on it.
If selection is disabled, then 2 clicks on checkbox are required. However, if state of checkbox was modified, then mouse click on another cell will not start edit-mode for clicked cell/row, because at that point editor loses focus, dataSource is updated with modified data and grid is rerendered to reflect changes. Therefore, if that click happens to be on another checkbox-cell, then changing its state will require 3 clicks.
I noticed that in your sample you try to cancel event by stopPropagation, preventDefaults, etc. That will not cancel event, but only may break functionality. In order to cancel action of cancelable event, application should return false from handler. Canceling events raised by widgets includes only documented actions. In case of editCellEnding, that will only cancel update of data. If intention of application to continue editing, then that will not work. Note: in current version, the cell-editor is removed from document before editCellEnding is raised.
In currently available version, only editRowEnding supports special member/property "keepEditing" for 2nd ui parameter in event handler. Recently similar option was added to the editCellEnding, which will be available only for editMode="cell". Future service releases will have that option.
I hope that I explained logic/rules used by igGridUpdating and igGridSelection. If I missed something, then I will be happy to clarify my answers and replay on other questions.