angular-ui/ui-grid

Multiple functions get called when used in columnDefs's field

Open

#6326 aperta il 20 lug 2017

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
help wantedseverity: performance

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

My issue is like what @chanont-poon mentioned about in this issue https://github.com/angular-ui/ui-grid/issues/3753

I want to assign a function to columnDef's field but the function is getting called multiple times even when you double click the cells and get out of the cells. Check the example of the plunker: http://plnkr.co/edit/s2f94eTtkyKvPFW5QfG2?p=preview (Check the console and see how it behaves)

And I found this tutorial (http://ui-grid.info/docs/#/tutorial/316_dynamic_data_changes). Is it because of like what this tutorial mentioned about?

On every digest cycle every binding is evaluated to see if anything has changed, and updates made as appropriate. ui-grid explicitly seeks to avoid this.

I wish someone can help me with this because this is a serious issue. Because the page will keep calling it all the time and this could slow down the page to be loaded.

Is it a default behavior and why is it behaving this way?

Guida contributor