AngularJS (ng-grid) "editableCellTemplate" remains in edit mode on loss of focus
Asked Answered
P

1

8

In the latest version of ng-grid(v2.0.7), when a editableCellTemplate is in edit mode and loses focus, it remain in edit mode. Is this a bug or did I configure the grid incorrectly?

Here's an example: http://plnkr.co/edit/OgEjk7wFaC982FrKbeHH?p=preview where column 0 contains the editableCellTemplate.

Potboy answered 16/7, 2013 at 15:9 Comment(0)
P
6

I found the answer in one of the templates inside of ng-grid.js. I was missing ng-input="COL_FIELD"

  <select ng-cell-input ng-class="'colt' + $index" ng-input="COL_FIELD" ng-model="COL_FIELD">
      <option>nl</option>
      <option>fr</option>
      <option>en</option>
  </select>
Potboy answered 17/7, 2013 at 15:41 Comment(1)
Thanks to your answer I solved a similar problem. The official ng-grid documentation [angular-ui.github.io/ng-grid/] doesn't specify the ng-model="COL_FIELD" attribute for the default editableCellTemplate while it's neededParfitt

© 2022 - 2024 — McMap. All rights reserved.