JqGrid keyboard navigation - jqgrid

I have an editable Jqgrid(where when im clicking on a row, that row get editable) with 3 dropdown lists in it, what i want is:
when im clicking on a row, its get editable and selects first dropdown in a row
after i choosed an object in dropdown list and pressed tab it jumps to the next dropdown (already happends)
same as the 2. but it have to jump to the third dropdown list
when im done editing, when i press down key or just press somewhere else on the screen data which i edited should be saved to DB. so it have to happend withount me pressing enter key, which i have to do now.
if i press down key, selection have to jump down to next row and save the previouse row which i just edited
I know its a long one, but i cant get path keyboard selection because im stuck with clickable edit....

If you don't use multiselect:true you can use bindKeys method to have keyboard support.
If you need to change the order of focus on Tab pressing you can change tabindex attribute on the editable fields (input or select elements). You can use oneditfunc parameter of editRow for such initialization actions.

Related

Kendo Hierarchy Grid clear selection

I am playing with this example by Kendo: http://dojo.telerik.com/EneFe
I have modified it so that the rows are selectable (selectable:true).
I have added a button on the top which calls the grid.clearSelection() function.
This is supposed to clear all selection but it does not clear the selection of rows that are selected in the dropdown table. (Recreate: click on the first row "Nancy", expand it and click on "10258 - Austria", then click the "Clear Selection" button and only "Nancy" will clear)
Is the function not working properly or am I misusing it?
In any case - how can I achieve a total clearing of all selected rows?
This is because they are two separate grids. Check this:
http://dojo.telerik.com/EneFe/2

Changing RadGrid row selection behavior

I have a RadGrid with AllowMultiRowSelection="true", EnablePostBackOnRowClick="false", and UseClientSelectColumnOnly="false". The documented behavior is:
When multi-row selection is enabled, clicking on a row still de-selects any other selected rows. Users can select multiple rows by holding the Ctrl key down while clicking on a row.
However, the behavior for the "Client Select Column" (i.e. a checkbox column) is to toggle the row when the checkbox is clicked.
I want to apply the checkbox behavior (toggling) to any click on the row. I know this isn't the intended behavior of the grid, but it ought to be possible through some client-side scripting (i.e. click the row and it toggles the appropriate checkbox). Can anyone help me figure out such a script?
To avoid deselection of any other selected rows by click on the specific row you can just set UseClientSelectColumnOnly="True". As result you can toggle checkbox only by click on the checkbox.
It doesn't help you with click on the row, but it helps to avoid unexpected deselection.

jqgrid: using setselection as if the user clicked on the row?

I have a grid (master/detail) with keys bound. I'd like to have the first row in the master grid automatically selected when the page starts.
I used setSelection in the GridComplete event and can get the row selected. However, the up/down arrows (and the detail grid) do not function until the user actually clicks on a row with the mouse.
Does anyone have any ideas about how to get a row selected programatically so that the grid operates as if the user had clicked the row?
Thanks,
-Bill
The problem is that the grid does not have focus, so keyboard commands are not routed to it when the grid is initially displayed. You can work around this by explicitly calling focus after setting your initial selection:
jQuery("#myGrid").setSelection(myID).focus();

how to select item using Enter and enable double click in jqgrid in inline edit

Enter does not select item in select element in inline edit and blocks double click.
Steps to reproduce:
Open
http://trirand.com/blog/jqgrid/jqgrid.html
in IE9
Select
Row Editing (new)
Input types
Double click in first row "Desktop computer"
to start inline edit
Click in "Ship via" column in first row FedEx fiel to open dropdown.
Press Down arrow key to select Intime
Press Enter
Observed:
FedEx appears in Ship Via column
Double click in this row not more starts inline edit
Expected:
Intime should appear
Double click should put row in inline edit mode again.
How to fix ?
I suggest to solve the problem like in the change. The idea is very easy. Is one change focus many required finalization actions can be done in the current control. For example in case of <select> the 'change' event will be fired, onfocusout will be called and popup menus (context menu or datepicker) will be closed and so on.
SO I suggest to add the line
$(ta).closest("tr.jqgrow").focus();
inside of 'keydown' event handler after the line. The results you can see on the demo.

Telerik RadGrid opening an extra popup edit form when pressing "enter" from a popup form for inserting

I have a radgrid that uses the popup edit mode with a custom edit template. The edit form upon pressing the enter key will insert a new item into the grid. I go in and add an item. This successfully inserts. Then I go to add a second item: The popup form appears. I enter in my data and press the "enter" key to insert the item. This time, instead of inserting the item, my edit form will clear out the data I entered and open another popup edit form to allow editing of my previously inserted item (from the first time). I now have 2 popups (1 for inserting, 1 for updating).
If I click the insert button instead of pressing "enter", then everything works ok. From what I can guess is that it is thinking that I'm pressing the enter on a selected row on the grid. How do I prevent it from triggering the "edit" event while I'm trying to insert?
Thanks
Try adding a panel to the edit template and set the DefaultButton to your Insert button.
<asp:Panel ID="pnlEditor" runat="server" DefaultButton="btnUpdateItem">

Resources