ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

bootstrap-typeahead is not working in ng-grid.

Open arnabdas opened this issue 13 years ago • 2 comments

I'm working in a project, where I have to show a typeahead in a ng-grid cell. But, the typeahead is not working in a ng grid cell. I have put a Plunker.

See that the typeahead is working in the same page above the grid. But it's not working in the ng grid cell. Can you please help?

arnabdas avatar May 17 '13 10:05 arnabdas

I believe I have it working: http://plnkr.co/edit/cum0CBuoJUvGIBu85aBS?p=preview

  1. The .ngCell class by default hides overflow. You need to override that so that the typeahead popup will be visible.
  2. In your cell template. the input needs to be wrapped in a div for the typeahead popup to be inserted into the DOM.
  3. You have to bind to myData (or whatever your data variable is named) in the template, as ngGrid doesn't store the evaluated data object somewhere accessible in the scope, but does inherit from the parent scope.
  4. I went ahead and set up how you would bind to different models for the typeahead ng-model directive (i.e. use an array).

c0bra avatar May 20 '13 17:05 c0bra

@c0bra Your solution is fine for cases where pre-existing data doesn't exist; however, what if you need your typeahead to be bound to the data property of gridOptions? How do you then propagate changes back to the data?

jamesroydennis avatar Oct 28 '13 23:10 jamesroydennis