Reputation: 41
I try render html to table, I see output correct but without formatting / rendering html code.
grid.js
<script>
$("#tableGrid2").Grid({
className: {
table: 'table table-sm table-hover table-striped mb-0'
},
pagination: {
limit: 20,
summary: true,
server: {
url: (prev, page, limit) => `${prev}?limit=${limit}&offset=${page * limit}`
}
},
server: {
url: `<?= site_url('DashboardController/getVendorSales') ?>`,
then: data => data.data.map(product => [
"<div style='padding: 2px; border: 1px solid #ccc;border-radius: 4px;'>" +
"<center>hello!</center>" +
"</div>",
product.id,
product.order_number,
product.price_total,
// Add more properties as needed
]),
total: data => data.total // Use total directly here
}
});
</script>
this part of code I see pure html in table:
"<div style='padding: 2px; border: 1px solid #ccc;border-radius: 4px;'>" +
"<center>hello!</center>" +
"</div>",
Can anyone help me? I try read documentation but I cannot resolve this.
Upvotes: 0
Views: 121