This is a migrated thread and some comments may be shown as answers.

In batch editing with locked column no focus on first cell

3 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Konstantin
Top achievements
Rank 1
Konstantin asked on 04 Sep 2019, 06:05 AM

Hello,

In batch editing with locked column no focus on first cell.

In batch editing when i am add row, first cell get focus. If add first locked column. first cell didn't get focus.

Exemple:      https://dojo.telerik.com/ucEraQOW

3 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 05 Sep 2019, 11:26 AM
Hi Konstantin,

Thank you for the provided Dojo sample.

Generally, when the navigatable property of the grid is enabled, the focus is intentionally removed. What actually happens is that the cell is opened for editing rather than focused. And when a locked column is present, the grid would search for an editable cell in the locked content only. In order to check in the non-locked content as well override the following function:

kendo.ui.Grid.fn._editModel = function(model) {
  var that = this;
  var createAt = that.options.editable.createAt || "";
  var mode = that._editMode();
 
  if (model) {
    var id = model.uid,
        table = that.lockedContent ? that.lockedTable : that.table,
        row = table.find("tr[" + kendo.attr("uid") + "=" + id + "]"),
        cell = row.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(that._firstEditableColumnIndex(row)),
        cellCount = row.find("td").length;
     
    if(!cell.length){
      table = that.table
      row = table.find("tr[" + kendo.attr("uid") + "=" + id + "]")
      cell = row.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(that._firstEditableColumnIndex(row) - cellCount)
    }
    if (mode === "inline" && row.length) {
      that.editRow(row);
    } else if (mode === "popup") {
      that.editRow(model);
    } else if (cell.length) {
      that.editCell(cell);
    }
 
    if (createAt.toLowerCase() == "bottom" && that.lockedContent) {
      //scroll the containers to the bottom
      that.lockedContent[0].scrollTop = that.content[0].scrollTop = that.table[0].offsetHeight;
    }
  }
}

And the corresponding Dojo sample:

https://dojo.telerik.com/aJEsAnud

Let me know in case any questions arise.


Best regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Konstantin
Top achievements
Rank 1
answered on 05 Sep 2019, 11:55 AM

Hello,

Maybe you change it in release? I don't want add this in self code. I tested it. It look good.

0
Tsvetomir
Telerik team
answered on 09 Sep 2019, 05:58 AM
Hi Konstantin,

I am glad to hear that the provided workaround looks good for you. 

Unfortunately, adding features to the existent logic would have to undergo extensive testing and approval from the development team. Therefore, I have logged an issue in our Feedback portal on your behalf:

https://feedback.telerik.com/kendo-jquery-ui/1428681-grid-with-incell-edit-and-frozen-columns-would-not-open-for-editing

If you would like to follow its progress in the GitHub issue, here is a link:

https://github.com/telerik/kendo-ui-core/issues/5254

I hope you find this helpful.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Konstantin
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Konstantin
Top achievements
Rank 1
Share this question
or