Forum
Topic RSS
10:10
Moderators
30/10/2007
OfflineHello,
The reason that is not answerd is that this requirmend is discussed many times here and you can find them using the search button.
Any way you can use afterInsertRow event (do not forget to set gridview mode to false in this case)
You can find more about this event here:
http://www.trirand.com/jqgridw.....iki:events
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:10
Moderators
30/10/2007
OfflineHello,
It work on both cases - from the request and when you add a row with addRowData.
Best Regsrds
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
19:04
28/12/2009
Offlinetony said:
Hello,
It work on both cases – from the request [Image Can Not Be Found]
[Image Can Not Be Found][Image Can Not Be Found]and when you add a row with addRowData.
Best Regsrds
Tony
Thank you for the reply.
In my situation I don't need to edit fields. However I would like to highlight fields of a column that are less than an integer value that equals 600
19:29
Moderators
30/10/2007
OfflineHello,
use a custom formatter for this purpose - here is example
http://www.trirand.com/jqgridw.....er#example
Reagrds
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
03:00
28/12/2009
Offline
Jason said:
Tony,
Re: afterInsertRow
I currently have gridview: true for the grid in question and need that on due to the size of the cols and records returned.
Is there any other way to change a row's color based on something found in the SQL?
Jason
Jason,
Yes there is a way and it seems to be rather easy if you know jquery and a little about css.
If you look at this post Custom fonts and colors for cells I have the javascript required for looking at a cell in Colmodel which is populated by mysql, I then use a function to make changes if the value in each cell is less than 600 return the original content plus the modification. In this case I have not been able to apply a color yet as I don't exactly how to apply a color to it but the most difficult part has been accomplished.
PS: I think Tony is the only one who answers questions and I think he might be off or something, haven't seen anything from him in the last 2 days.
16:02
Thanks 😉
I can get it to work using jQuery. I was hoping for something more built-in rather than bolted on. But, there is not an obvious solution out so I may just have to bolt it. When I parse the data back from my DB, I will perfom my conditional statement in that loop. If it needs to change colors I will set a hidden field with a certain value, then when the grid is complete, I will use a custom function to check that value and modify that entire row to a color if required.
05:48
28/12/2009
OfflineFigured out how to change the color on the cell, anyone know how to do it on the entire row?
...
colModel:[
{name:'SKU Count',index:'item_count', width:80,align:"right",searchoptions:{sopt:['eq','ne','lt','le','gt','ge']}, formatter:highlight},
...
function highlight (cellValue, options, rowObject) {
var color = (parseInt(cellValue) < 10000) ? "red" : "green";
var cellHtml = "<span style='color:" + color + "' originalValue='" + cellValue + "'>" + cellValue + "</span>";
return cellHtml;
}
...
19:10
Moderators
30/10/2007
OfflineFor professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 994
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home
Jason said: