Column text color when it takes focus.

QuestionsColumn text color when it takes focus.
Javier asked 3 years ago

Hello!

I have modified the color of a column of my grid, using:

$grid[“loadComplete”] = “function(ids) { onloadFunction(ids);

The onloadAssistances function is as follows:

function onloadFunction(ids) {

var ids = $(“#lstStudents”).jqGrid(‘getDataIDs’);

for (var z=0;z<ids.length;z++) {

var id=ids[z];

$(“#lstStudents”).jqGrid(‘setCell’,id, ‘quarter1’,”, {‘background’:’rgb(250, 250, 250)’}); $(“#lstStudents”).jqGrid(‘setCell’,id, ‘quarter1’,”, {‘color’:’rgb(0, 0, 0)’});

} }

When selecting a row, the column whose color I modified in the onLoadFunction function remains with the established color, that is, it does not take the defined color of a selected row. How would I make the modified column also have the background color and text color of the rest of the columns?

Image to clarify better: https://imgur.com/Uhr2sb3

Thank you very much for the help.

 

1 Answers
Abu Ghufran Staff answered 3 years ago

A simpler solution is to use opacity of the cell color so that when row is selected the cell get’s the selection shade as well.

Changing rgb(…) to rgba(250, 250, 250,0.6) will set gray color with 60% opacity. You can adjust accordingly.

$("#lstStudents").jqGrid('setCell',id, 'quarter1',", {'background':'rgba(250, 250, 250,0.6)'});

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

16 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?