Skip to content
the poor coder

telerik jquery grid trigger editcell

Poor Man
Published
Reading time
1 min read
On this page

Telerik jQuery Grid Trigger EditCell#

As a front-end developer, I have worked with Telerik's jQuery Grid plugin on multiple occasions. One common use case is to trigger the editing of a cell programmatically. In this article, I will explain how to achieve this and provide some examples.

The Solution#

The first step is to get a reference to the Grid object. This can be done using either the data() method or the getKendoGrid() method:

JavaScript
var grid = $("#grid").data("kendoGrid");
//or
var grid = $("#grid").getKendoGrid();

Once you have a reference to the Grid object, you can use the editCell() method to trigger the editing of a cell. The editCell() method takes two arguments: the row index and the column index of the cell to be edited:

JavaScript
grid.editCell(0, 0);

This example would trigger the editing of the first cell in the first row of the Grid.

Additional Options#

The editCell() method has several additional options that can be passed as an object argument. For example, you can specify whether to open the cell in edit mode or not by setting the isEdit option to true:

JavaScript
grid.editCell(0, 0, { isEdit: true });

You can also specify the direction of the navigation (i.e., which cell will be focused after the edited cell) using the direction option:

JavaScript
grid.editCell(0, 0, { direction: "right" });

This would navigate to the cell to the right of the edited cell after editing.

Conclusion#

Triggering the editing of a cell programmatically can be a useful feature in many scenarios. Thankfully, Telerik's jQuery Grid plugin makes it easy to achieve this with the editCell() method. By passing in the row and column indices of the cell to be edited (along with any additional options), you can open the cell for editing and provide a seamless user experience.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC