bootstrap icon indicating copy to clipboard operation
bootstrap 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

@arnab-das so, spent quite some time tracking all the problems in your plunker, there were quite a number of them:

  • you were missing ng-model directive on the input elements used in grid's cell, there were many errors in the console
  • typeahead window is appended as an element after an input element so it means that you need to have it wrapped in a parent DOM element, ex.: <div>

The 2 above changes made the typeahead work - well - partially. The correct DOM structure is generated etc. but nothing gets displayed due to CSS conflicts. It seems like both typeahead popup and a cell in a grid are absolutely positioned. This is a bit surprising for a grid but OK. The real problem, though, is that the .ngCell class has the overflow: hidden; property and it makes the typeahead popup invisible.

If you remove the overflow: hidden; from the .ngCell it all starts to "work": http://plnkr.co/edit/pzLb3079yuhDtW1XIxvq?p=preview

I guess we are facing conflicts of Bootstrap's CSS and ng-grid CSS. We can't change Bootstrap's CSS in this project so I will let your persuade the topic with the ngGrid folks.

pkozlowski-opensource avatar May 17 '13 19:05 pkozlowski-opensource

Thanks a lot @pkozlowski.opensource. This was probably a completely new requirement regarding ng-grid and bootstrap-typeahead. Actually I'm new to AngularJs. So, the mistake was made. Again thanks for your time.

I've also raised the issue in ng-grid issue tracker. I'll change the css of the ng-grid.css. Another thing is that, is this possible to show the value in the cell in the typeahead input box initially.

arnabdas avatar May 18 '13 14:05 arnabdas