Search code examples
javascriptpolymer-1.0predix

Need help in rendering HTML Code to px-data-column with type="html"


I have written a table in polymer 1.0 using px-data-table and I want one of the column in this table to present a checkbox option.

I am having trouble in writing filterFunctionName and how to render html code in the particular column.

'''
<px-data-table id="mytable" filterable selectable table-data="{{minidata}}">
   <px-data-table-column name="first" filterable sortable editable>
    </px-data-table-column>
    <px-data-table-column name="last" editable sortable> 
    </px-data-table-column>
    <px-data-table-column name="Checkbox" type="html" filterable
     filter-function-name="myTableCustomFunctions.Rendercheckbox()">
     </px-data-table-column>
 </px-data-table>
'''

In the table I need to see a check box in the last column. I have tried in many ways to render that small piece of html code by using DOM or using filter function name. Can anyone help me in understanding how to actually add html code here.

Thanks.


Solution

  • data.Checkbox="<input type='checkbox' id="checkbox1" name="checkbox1" class='selectAll'/>"; 

    I will add this snippet in my page where i am inserting data into table. so when this snippet is inserted into the same column with type="html" it will show me a checkbox.