Question

I turn to you stackoverflow!

I'm using a kendo ui batch grid with InCell editing set and am wanting to know a way to set a particular column into edit mode.

I've tried using editCell, and so far it hasn't caused any of the cells to go into edit mode :(

In this particular case, we have a ClientTemplate column specified which has a button (really its a link...) in it. When the user clicks the button I would like a particular cell in that row to switch to edit mode. For reference here's what the specific column template looks like:

 columns.Template(t => { }).HeaderTemplate("")
                .ClientTemplate(@"
                    <a href='javascript: void(0)' class='abutton SecondaryActiveBtn'     onclick='editVariableRate(this)' title='Edit'>Edit</a>")
                .Width(100).Title("");

Here is the particular javascript method that gets called on the button click:

 function editVariableRate(element) {
        grid = $("#variableFee").data("kendoGrid");     
        var cell = $(element).closest("tr").find("td:eq(2)");
        grid.editCell(cell);
}

Am I doing something wrong here because the particular column never goes into edit mode?

For reference, I can do the following successfully using the same "cell" variable:

var cellIndex = grid.cellIndex(cell);

and cellIndex gets assigned correctly, so I don't think its a problem of selecting the particular cell...

Anybody have any ideas?

Was it helpful?

Solution

Figured it out! It was the link that was the cause of the problem :( Swapping that to be an input button was the only thing that was needed. bangs head into desk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top