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

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">

Related

Oracke ADF 12c: Refresh Table within a popup after entering filtering criteria

Hello we are using oracle ADF 12c. We have some popups with tables blocks and at the top of each table column, there is data filter/search box. Whenever a data is entered in the filter box and "Enter" is pressed the popup gets closed automatically. Next time the popup is opened, the filtered data appears
The problem which I see is that by pressing "Enter", automatically "OK" button is clicked. How can we prevent this to happen and let the popup just refresh the table block only when "Enter" is pressed.
This works very well if the table block is not in a popup, by pressing enter, the blocks gets refreshed and data is appeared but doesn't work in popup and we need to filter data in table blocks of popups also.
Make sure that the popup property autoCancel is set to false. Then I can only assume you use an af:dialog of type OK or OKCANCEL. You can use the type NONE and handle the OK and CANCEL button yourself, just as any other regular button.
Add actionListeners to the buttons, and inside the listeners, you close the popup.

Kendo grid - close addRow and display edit row

I have grid, with inline edit function. When I click to Add Record button, new editable row is displays. When i click on edit button in another row, the add row is cenceled and I must click again on edit button.
So, I must click twice on edit button if I befere clicked to Add Record button. It is possible to edit row in one click maybe in Grid Edit event ?
#(Html.Kendo().Grid<TT.Web.Models.ViewModel.WorkViewModel>()
.Name("gridAdd")
.Events(events => events.Edit("gridEdit").DataBound("databoundinitAdd").Save("gridAddSaveChanges"))
Maybe:
function gridEdit(e){
$(".k-grid-cancel").click(); // remove ADD record ROW (no work)..
Thanks
The only solution that I can think of currently is to define custom buttons with custom "click" event handlers for the "cancel", "update" and "edit" commands. For your convenience I created small example which you can use as baseline to achieve the desired behavior:
http://dojo.telerik.com/EqOmU/3

How to prevent auto select row action when in editmode in JQGrid on click of next & prev navigation button on popup

when I doubleclick on the row, it will give edit popup. This edit popup has left and right error key, when I click on that Arrow key , it will select the row in background. so I want to prevent the Auto select row when click of JQGrid Editpopup's Next and previous button.
so when I click on the next button it will select the row in my Grid table.How do I prevent this behavioir? in below image it mention
Please help me. I have tried "onclickPgButtons", but not able to trigger it.
Thanks in Advance.
You can't prevent selection of the new row, but you can just call setSelection with just selected row to unselect it. The code of afterclickPgButtons could be the following
afterclickPgButtons: function (whichButton, $frmgr, justSelectedRowid) {
$(this).jqGrid("setSelection", justSelectedRowid);
}
See the corresponding demo here.

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.

JqGrid keyboard navigation

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.

Resources