grid row color and button color in acumatica
<CallbackCommands>
<px:PXDSCallbackCommand Visible="false" Name="FilesUpload" DependOnGrid="grid" />
</CallbackCommands>
<ClientEvents CommandPerformed="setActionButtonColor" />
<ClientEvents AfterCellUpdate="UpdateItemSiteCell" /> //it will use for after row updation grid change color of row.
<script type="text/javascript">
function UpdateItemSiteCell(n, c) {
var activeRow = c.cell.row;
if (px_all && px_all["ctl00_phG_tab_t0_grid"] && px_all["ctl00_phG_tab_t0_grid"].rows) {
let lines = px_all["ctl00_phG_tab_t0_grid"].rows.items;
for (let i = 0; i < lines.length; i++) {
let currentLine = lines[i];
alert(currentLine.getCell("Popup").getValue());
currentLine.style = 'background-color: red';
currentLine.repaint();
}
}
}
</script>
<script type="text/javascript">
function setActionButtonColor() {
if (px_all && px_all["ctl00_phG_tab_t0_grid"] && px_all["ctl00_phG_tab_t0_grid"].rows) {
let lines = px_all["ctl00_phG_tab_t0_grid"].rows.items;
for (let i = 0; i < lines.length; i++) {
let currentLine = lines[i];
alert(currentLine.getCell("Popup").getValue());
currentLine.style = 'background-color: red';
currentLine.repaint();
}
}
var x = document.getElementsByClassName("toolsBtn");
var i;
for (i = 0; i < x.length; i++) {
if (x[i].getAttribute("data-cmd") === "attachments") {
// alert(x[i].getAttribute("data-cmd"));
x[i].style.backgroundColor = "red";
//x.style.borderColor = "red";
// alert(x.style.borderColor);
}
}
};
</script>
Comments
Post a Comment