kendo grid auto scroll on first click - kendo-ui

Only on first click on kendo grid widget (thead or tbody), the page scroll as shown on attached gif.
The problem is due to tabindex attribute added to table when 'allowCopy' is enabled.
Removing tabindex attribute in jquery, the scroll issue disappear, but copy doesn't work.
Any way to avoid this annoying behaviour?

Related

Bootstrap tooltip doesn't hide when modal triggered if placement=body

I have a kendo grid which each row has an edit button. I am using Bootstrap to add a tooltip to the edit button, as well as other things. The edit button brings up a window to edit the attributes of the row model.
The tooltip kept getting cut off by the boundaries of the grid. To solve this I used placement=body when initializing the tooltips.
The problem I have now, is that the the tooltip does not hide if the button is clicked, and the editor window comes up. I tried changing the trigger to just be 'hover', but that did not help.
I tried doing ('[title]').tooltip('hide') in the edit event of the grid, but that doesn't seem to work at all.
I believe the problem has to do with 'edit' opening a kendo window. Because the other buttons with tooltips are fine, as they trigger a BootstrapDialog.
What happens is that the .tooltip has a z-index of 1070 while .modal has a z-index of 1050.
You can add the following to your css to ensure that .tooltip is displayed below .modal :
.modal{
z-index: 1071;
}
Of course, this means that you absolutely can't have a tooltip displayed from inside your modal, so this maybe doesn't suit your specific needs.
If that's the case, you should be able to add another class to your tooltip div and override the z-index on this class.
I'm well aware of the monkey-patch nature of this fix, but I've looked for a solution for this for weeks and couldn't find anything better.

Kendo UI Toolbar and Grid - strange save behavior when triggered from Toolbar control

I have some pages where I have a kendo ui grid (wired up to full CRUD services), but use a separate Kendo UI Toolbar control (as opposed to the toolbar configuration in the grid itself). I have a number of different buttons/menus on the toolbar, but am seeing a strange behavior when calling saveChanges() on the grid. If a cell is being edited when the save button is clicked, the grid is saved, but the edited value is lost (it reverts back to where it was). The following details what I see in different situations:
When using a save button configured in the grid (command: "save"), any changes in a cell being edited are committed with the save.
When using a plain html button that calls the saveChanges() method of the grid, any changes in a cell being edited are committed with the save.
When using a save button configured in a toolbar control, the changes in a cell being edited are LOST when saveChanges() is called.
The following jsbin shows the behavior of all three:
http://jsbin.com/jazobexatu/2/edit?html,js,output
I have tried calling the save from the toolbar button a number of different ways (even trying to trigger the click event of the external button), but nothing seems to correct the behavior. I also tried calling closeCell() on the grid (to try to force the value back into the data, but that doesn't work either). I haven't been able to debug the javascript enough to figure out what is different. I'm hoping someone with a deeper understanding of these controls can help me out.
For some reason, the mouse down event on the toolbar button doesn't cause a blur on the editor.
You can try it yourself by clicking in the cell to edit it, then click and hold the mouse button down on the "normal" button. The editor closes on mouse down, causing a blur of the editor, and persists the change.
If you do the same thing, click and hold mouse down, on the toolbar button, the editor stays open.
I've been poking through the source, but haven't figured out exactly why this happens. My best guess would be that the mousedown handler on the toolbar prevents the event from bubbling or running its default action and the editor doesn't blur.
Additional detail: On mousedown on the grid header button and the normal button, the focused element changes (which is what causes the editor blur). But on mousedown of the toolbar button, the editor input element still has the focus.
Shifting the focus on mousedown of the toolbar might be a workaround.
Sort of a weird hack, but this works in Chrome (any should in any browser that supports activeElement
click: function (e) {
$(document.activeElement).blur();
$("#grid").data("kendoGrid").saveChanges();
}

jqGrid inline editing with dynamic scroll - scrolling issues

I'm using jqGrid with dynamic scrolling and I'd like to use the Inline editing with inlineNav incl. Oleg's solution which makes inline editing finaly useful.
I found dynamic scrolling problematic because not all rows are loaded (and rendered) and Inline editing methods goes wrong when scrolling. To avoid problems, user can't scroll out:
can't scroll after selecting the row and then using add/edit
can't scroll even without selecting the row, because with no selection, first position is applied (3rd video)
can't scroll while adding/editing a row (one solution may be temporarily disabling the scroller)
Links:
demo: http://jsfiddle.net/dmnc_net/tNGJn/
scrolling with beforeSelected: http://youtu.be/osvwiykcuME
scrolling with first and last: http://youtu.be/Du_TBrlrzSI
scrolling without clicking any row: http://youtu.be/pCzpk1SvQNA
I've used these addRow position settings: beforeSelected, first and last; before and after are not working at all.
I'm thinking about solve this problem by patching addRow and editRow methods by telling them scroll position and handling loaded/unloaded "pages" when user has scrolled too far and selected record are unloaded. But I'm not sure if this is possible or it will be better to use modal add/edit dialogs.

How to make cell save when slickgrid looses focus

I have a SlickGrid with some Editors on a form with some buttons above it. (Save and Cancel). When i edit a cell in the grid and click the buttons above the grid - the cell does not commit it's edit. I've debugged and it is not calling : commitCurrentEdit. I've also tested on clicking an empty area anywhere out of the grid area...
Has anyone noticed this scenario and have a solution to get the cell to commit when one clicks out of the grid. Due to the various positions the grid good be in it would be hard to do an overlay.
Thanks
You can try this:
$("#buttonName").bind("click", function(){
gridName.getEditController().commitCurrentEdit()
});

Slickgrid autoscrolling window on grid click

When enableCellNavigation is enabled, the initial click and double-click on my grid immediately scrolls the page down so that the clicked row is at the top of the screen. This is quite annoying since it is not expected. Is there some way to turn this off? If enableCellNavigation is disabled, rows cannot be selected so this is not an option.
You are looking for focusOnCurrentCell()
In my case grid was scrolling to the end horizontally when clicked.
Commenting the focusOnCurrentCell() inside the function setSelectedCell(newCell,editMode) solved my problem.

Resources