Angular - kendo-grid-column - Bind html data -


can directly bind pre formatted value kendo grid column? data contains html tags , want column render data formatting , not treat tags text. use ng-template achieve desire output need parse whole data, store different keys , use them format in .html file. there anyway make kendo render html inside column?

you can render html using wrapper element within cell template, , bind innerhtml property data item field, containing html render, e.g.:

<kendo-grid-column field="htmlfield">               <ng-template kendogridcelltemplate let-dataitem>                 <div [innerhtml]="dataitem.htmlfield"></div>               </ng-template>             </kendo-grid-column> 

model:

{         "productid": 1,         "productname": "chai",         "supplierid": 1,         "categoryid": 1,         "quantityperunit": "10 boxes x 20 bags",         "unitprice": 18,         "unitsinstock": 39,         "unitsonorder": 0,         "reorderlevel": 10,         "discontinued": false,         "category": {             "categoryid": 1,             "categoryname": "beverages",             "description": "soft drinks, coffees, teas, beers, , ales"         },         "firstorderedon": new date(1996, 8, 20),         "htmlfield": "<h1>rendered html</h1>"     }, 

example


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -