473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

i want to compare two rows of same coloumn how i do it using javacript below is mycod

Expand|Select|Wrap|Line Numbers
  1. var cellclass = function (row, columnfield, value) 
  2.                           {
  3.  
  4.                               //alert("row==>"+row+"column==>"+columnfield+"value===>"+value);
  5.                               var oldValue="";
  6.  
  7.                               //alert(valueOfPrevious);
  8.                               if (row == "0") {
  9.                                   oldValue=value;
  10.                                    colorValue='red';
  11.                                    return colorValue;
  12.                               }
  13.                               else 
  14.                               {
  15.                                   colorValue='red';
  16.                                   var data = $('#new_grid_data2').jqxGrid('getrowdata', row - 1); ///
  17.                                  var valueOfPrevious=data.ips;
  18.                                  //alert(valueOfPrevious);
  19.                                  var currValue=value.substr(0,value.lastIndexOf(".")+1);
  20.                                  //alert(value+"=====>"+currValue);
  21.                                  var previousValu=valueOfPrevious.substr(0,valueOfPrevious.lastIndexOf(".")+1);
  22.  
  23.                                  if (currValue==previousValu) 
  24.                                  {
  25.  
  26.                                      if(colorValue=="red")
  27.                                      {
  28.                                          //colorValue="red";
  29.                                        return 'red';
  30.  
  31.                                      }else {
  32.  
  33.                                          colorValue="";
  34.                                          return '';
  35.  
  36.                                      }
  37.                                  }
  38.                                  else {
  39.                                      if(colorValue=="")
  40.                                      {
  41.                                          colorValue="red";
  42.                                        //return '';
  43.  
  44.                                      }else {
  45.                                          colorValue="";
  46.                                          //return 'red';
  47.  
  48.                                      }
  49.                                      //colorValue="";
  50.                                      return colorValue;
  51.  
  52.                                  }
  53.                           }
  54.  
  55.                           if (value < 20) {
  56.                            return 'red';
  57.                           }
  58.                           else if (value >= 20 && value < 50) {
  59.                            return 'yellow';
  60.                           }
  61.                            else return 'green';
  62.                            }
Sep 15 '15 #1
10 1312
Dormilich
8,658 Expert Mod 8TB
what problems do you experience?
Sep 15 '15 #2
i am comparing ips which are in a single column
see the below structure here Ref_ip & Ref_irl are two coloumns

Ref_ip Ref_url
1.1.1.1 1
1.1.1.2 1
1.1.1.3 1

1.2.2.1 1
1.2.2.2 1
1.2.2.3 3

so as you can se i have ips like this if i have ip's like this those are same i have want to change the colur of the row ..i am only comparing 1.1.1 & if they are same then colur should be chaged to red
Sep 15 '15 #3
Dormilich
8,658 Expert Mod 8TB
so as you can se i have ips like this if i have ip's like this those are same i have want to change the colur of the row ..i am only comparing 1.1.1 & if they are same then colur should be chaged to red
sorry, I didn’t understand that explanation. can you elaborate?
Sep 15 '15 #4
form image you can see tht there is column called REFERRING IP it contains some ip addresses but from filter when i give some value for eg 2 then all ips having same ips adgreses except last address shoule come one below anothe and their colour should change to red
exmple:- 101.101.101.111
101.101.101.112 these ip row color sholud change to red
Sep 15 '15 #5
this is screen shot.... refer it
Attached Images
File Type: jpg Screenshot from 2015-09-15 18:05:22.jpg (61.2 KB, 201 views)
Sep 15 '15 #6
Dormilich
8,658 Expert Mod 8TB
can you upload that in a better resolution? it’s hardly readable.
Sep 15 '15 #7
fere are the images.... find the files
Attached Images
File Type: jpg Screenshot from 2015-09-15 19:41:27.jpg (53.8 KB, 185 views)
File Type: jpg Screenshot2 from 2015-09-15 19:42:02.jpg (53.6 KB, 189 views)
Sep 15 '15 #8
Dormilich
8,658 Expert Mod 8TB
those are as small and unreadable as the previous one.
Sep 15 '15 #9
i am using ubuntu so the images are as it is please do something
Sep 16 '15 #10
Rabbit
12,516 Expert Mod 8TB
Nothing can be done if there's no good information to work with. If the screenshots are too small, try typing out the data instead.
Sep 16 '15 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

49
by: raju | last post by:
hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s
1
by: hiteshmangal | last post by:
Hi, How I can compare 2 xml files using c#.net. Thanks, Hitesh
1
by: Spoogledrummer | last post by:
Hi, I'm working on a report that uses a gridview to display the information, I've got to the rowdatabound part where I need to blank out some repeated fields if the values are the same as that of the...
3
by: fishjelly | last post by:
How to open new window through linkButton without using javacript?...
1
by: ronakinuk | last post by:
how to insert multiple rows in excel using vba how to insert multiple rows in excel using vba how to insert multiple rows in excel using vba
1
by: johnson1314310 | last post by:
duplicate rows occurring when using inner join,i want to join a table value to another table..
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.