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

Applying <span> around items in an array within cells

Open avizuber-zz opened this issue 13 years ago • 2 comments

Normal output within a cell is something like:

item1, item2, item3

Is it possible to change the output to:

item1, item2, item3

The next question would be, is it possible to apply this output to all the cells within a specific column?

Thanks!

EDIT:

Looks like my code doesn't appear within this post. Checkout the attached image. Thanks! screen shot 2013-10-02 at 10 40 20 am

avizuber-zz avatar Oct 02 '13 14:10 avizuber-zz

@avizuber you can set the cellTemplate property for the column in columnDefs. That's just a URL to an HTML file containing the code you want to appear in each cell for that column (or a string with the actual template code).

If you had the data as e.g. items = ['item1', 'item2', 'item3'], then your template could look like this:

<span ng-repeat="item in row.entity.items">{{item}}</span>

paulwsmith avatar Oct 02 '13 22:10 paulwsmith

Thanks, Paul W. Smith. You are a very helpful person. May you be blessed with many good things.

avizuber-zz avatar Oct 03 '13 15:10 avizuber-zz