Replies
Hello,
Thanks again.
Q2: Solved.
Q1: Can you tell me how do I trigger the "Add New Row" event. (Just open the editors for add new row, User will enter the column values)
$(document).on("keypress", function () {
$("#accSelectionGrid")….???? //+Add new row method?
});
Q3: Solved Now.
I tried doing the same like this :
$("#accSelectionGrid").attr("tabIndex", "0");
$("#accSelectionGrid").focus();
^ Now when I press up/down arrow key , the whole grid scrolls through its scroll bar, I need to navigate from one row to another using up/down arrow keys. I mean I dont want to scroll the grid rows through its scroller, I want it to navigate from one row to another. Writing the above two lines scroll the whole grid container.
$("#accSelectionGrid_container").attr("tabIndex", "0");
$("#accSelectionGrid_container").focus();
^ #accSelectionGrid_container did it.
Regarding the new thread point, I will keep that in mind, though I am only asking grid-keyboard-shortcut queries which the title of the thread suggests.
I hope I am not taking too much of your time, And I am not going to ask any new questions in this thread, just needed some more help on the ones I already asked. Thanks for your help & time , I appreciate it.
One more thing,
There is a bootstrap-modal window on my page which is opened on the blur event of a grid column in edit mode. As soon as the person blur from the column editor of the grid, the modal windows opens up. Now I want the user to navigate through the rows another grid which is in this modal window, but the focus is still on the background grid's opened editors and not the currently opened modal grid. I want to set focus on this mdoal's grid's first row now but I am not able to.
I tried :
$('#accSelectionModal').modal('show');
$("#accSelectionGrid").igGridSelection("selectRow", 0); // (This only highlights the first row)
This selects the first row of the modal window BUT pressing the up-down arrow doesnt navigate from row to row. I have to manually CLICK on any row and then pressing the UP/DOWN arrow keys works for navigation. How can I set focus on the modal's grid without click it, Is there any elemnt or Method though which this could be done, Calling Jquery's $('#accSelectionGrid').focus(); doesnt help because I think it requires an input field to set focus on & not the entire grid. I tried selecting the first row of the modal window, It gets highlighted but up/down arrow key dont work, Infact the focus is on the background grid of the page & not the modal window. How to set focus on Modal's grid programmatically and then use up/down arrow key without using the mouse or setting focus explicitly on the modal grid.
Thanks for your response.
Setting an ID though comboEditor options would do the deed.
I want to ask you about one more thing.
The combo which is in my grid is set as a required field.There is another column in the grid for which user has to open up a modal window and then select a value from somewhere and that gets entered in the editor of the grid. But when the user is using the modal window the Editor for grid are opened, when the user clicks on any of the modal window elements the Required combo column in grid starts to pop up "This field is required" message. Although user has not currently finished adding the row, He is infact going to select some value from some modal window to be added in the currently opened editors but the grid pops up required field pop up message on its blur. What is the solution to this problem. I want the Required field validator for grid combo to only work if the user presses Done button of the row editor or presses the enter key. How to tell the grid to not validate the combo on blur.
Hello ,
Thanks for the help.
Q1: The "Shift Tab" functionality is somewhat doing the task but it depends on the tab index and all that. I have used bootstrap master template the tab indexes are auto implemented in it therefore the whole page starts from my navigation menus of master page & then reaches the form elements but still doesnt tab into "add New Row", It tab into the column headers but on pressing shift tab it goes one column back but does not select "add new row".Then I had to explicitly re define the tab indexes of my form but still once it reaches the grid the tab then start from the navigation menus which is not what I need.
What i am looking for is somewhat a definite key for the "Add new Row" button functionality. For example if the user presses the "Insert" button without setting focus on the grid, the grid should open the Add new row editors. Basically its a client requirement that mouse wont be used, everything has to be done through keyboard.
How can I bind "insert" key to trigger "add new row" functionality whenever the user presses it. Could you please provide a short sample or code snippet to do that.
Q2: startEditTriggers is working fine with one key, How can I specify multiple startEditTriggers in MVC Helper syntax, I have used it like this:
.EditMode(GridEditMode.Row).StartEditTriggers(GridStartEditTriggers.Enter); (WORKS)
.EditMode(GridEditMode.Row).StartEditTriggers(GridStartEditTriggers.Enter,GridStartEditTriggers.DblClick); (DOESNT WORK)
Q3: This query is resolved.
Thanks for helping. Appreciate it.
Thanks Martin,
I am using MVC Helper syntax like this :
cs.ColumnSetting().ColumnKey("cur_cd").EditorType(ColumnEditorType.Combo).Required(true)
.ComboEditorOptions(co => co.DataSourceUrl("/mycontroller/getData").TextKey("cur_cd").ValueKey("cur_name")
.Mode(ComboMode.DropDown));
In this syntax, .AddClientEvent("selectionChanged", "myFunction"); is not available in the intellisense on indivisual columns like this:
cs.ColumnSetting().ColumnKey("cur_cd").EditorType(ColumnEditorType.Combo).Required(true)
.ComboEditorOptions(co => co.DataSourceUrl("/mycontroller/getData").TextKey("cur_cd").ValueKey("cur_name")
.Mode(ComboMode.DropDown).AddClientEvent("selectionChanged", "myFunction")); (Error)
However it is available immediately after features.Updating() like this :
features.Updating().AddClientEvent("selectionChanged", "myFunction") (Works)
I want to register the event only on cur_cd column & not on all columns, also if it cannot be done in MvcHelper syntax , How can I detect which column's selection changed is fired in the delegate handler, is there something like ui.columnKey something like that to determine which column's selection change is being fired.
One more thing , You can see in my .ComboEditorOptions that TextKey is cur_cd, ValueKey is cur_name , How ever I want TextKey= cur_name & ValueKey=cur_cd but this gives an error for some reason and works fine the other way BUT I see cur_cd as display text in the combo which I dont want, When I select an item than the selected item(after dropdown closes) becomes cur_name, but in the dropdown list it shows cur_cd. Any idea why this strange behavior ?