pedau
September 7, 2018, 10:47am
1
Hi,
I am trying to set the colour of a selected jqxgrid row.
The css is as below:
.jqx-grid-cell-selected {
background-color:blue;
}
I tried to use $("#Grid1 .jqx-grid-cell-selected").css(“background-color”, “blue”) but nothing happens.
Am i doing this wrong?
Thanks
Grid1.cells(r,c).style.backgroundColor = vbblue
pedau
September 8, 2018, 10:56am
3
Thanks for your reply.
What you’ve shown works for the common grid but not jqxgrid, which is what i am using.
Sorry. Late at night reply. Brain not fully engaged.
pedau
September 11, 2018, 12:17am
5
Has anyone else had any joy with colouring selected rows using jqxgrid?
This site here has the css code required to achieve this but I cannot make it work in NSB.
Thanks
pedau
September 13, 2018, 12:59pm
6
I came across a response on the jqwidgets forum that says row selection colour can be achieved using:
$('#grid').on('rowselect', function (event) {
$("#grid").jqxGrid('refresh');
setTimeout(() => {
let cells = $(".jqx-grid-cell-selected");
for (let i in cells) {
if (i < cells.length) {
let cell = cells[i];
cell.style.backgroundColor = 'red';
}
}
},5);
});
Can this be translated in NSB?
Thanks
ghenne
September 13, 2018, 2:05pm
7
This code is in JavaScript. AppStudio allows you to embed JavaScript snippets in your BASIC code:
JavaScript
(some code in JavaScript)
End JavaScript
pedau
September 14, 2018, 4:10am
8
Thank you, that’s got it.