You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello people.
I have a field in my database called 'status_fun' that is being loaded normally inside the grid.
In the images directory I put two images in the [images / flags] directory named '1.png' and '2.png'.
I need to show these images according to the value of the 'status_fun' field which can be '1' or '2', for that I'm using the example:
DatabaseGrid.prototype.initializeGrid = function(grid) { var self = this; // render for the action column grid.setCellRenderer("action", new CellRenderer({ render: function(cell, id) { cell.innerHTML+= "<i onclick=\"datagrid.deleteRow("+id+");\" class='fa fa-trash-o red' ></i>"; } })); getColumn("status_fun").cellEditor.minWidth = 105; setCellRenderer("status_fun", new CellRenderer({ render: function (cell, value) { cell.innerHTML = value ? "<img src='" + image("flags/" + value.toLowerCase() + ".png") + "' alt='" + value + "'/>" : ""; cell.style.textAlign = "center"; } })); grid.renderGrid("tablecontent", "testgrid"); };
The error returned is that the column 'status_fun' does not exist.
How do I make the column available so I can make this change?
The text was updated successfully, but these errors were encountered:
ticelso
changed the title
Inserir uma imagem conforme o valor do campo
Insert an image according to the field value
Aug 19, 2021
Hello people.
I have a field in my database called 'status_fun' that is being loaded normally inside the grid.
In the images directory I put two images in the [images / flags] directory named '1.png' and '2.png'.
I need to show these images according to the value of the 'status_fun' field which can be '1' or '2', for that I'm using the example:
DatabaseGrid.prototype.initializeGrid = function(grid) { var self = this; // render for the action column grid.setCellRenderer("action", new CellRenderer({ render: function(cell, id) { cell.innerHTML+= "<i onclick=\"datagrid.deleteRow("+id+");\" class='fa fa-trash-o red' ></i>"; } })); getColumn("status_fun").cellEditor.minWidth = 105; setCellRenderer("status_fun", new CellRenderer({ render: function (cell, value) { cell.innerHTML = value ? "<img src='" + image("flags/" + value.toLowerCase() + ".png") + "' alt='" + value + "'/>" : ""; cell.style.textAlign = "center"; } })); grid.renderGrid("tablecontent", "testgrid"); };
The error returned is that the column 'status_fun' does not exist.
How do I make the column available so I can make this change?
The text was updated successfully, but these errors were encountered: