473,672 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

6 New Member
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 1331
Dormilich
8,658 Recognized Expert Moderator Expert
what problems do you experience?
Sep 15 '15 #2
swap894
6 New Member
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 Recognized Expert Moderator Expert
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
swap894
6 New Member
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
swap894
6 New Member
this is screen shot.... refer it
Attached Images
File Type: jpg Screenshot from 2015-09-15 18:05:22.jpg (61.2 KB, 202 views)
Sep 15 '15 #6
Dormilich
8,658 Recognized Expert Moderator Expert
can you upload that in a better resolution? it’s hardly readable.
Sep 15 '15 #7
swap894
6 New Member
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, 191 views)
Sep 15 '15 #8
Dormilich
8,658 Recognized Expert Moderator Expert
those are as small and unreadable as the previous one.
Sep 15 '15 #9
swap894
6 New Member
i am using ubuntu so the images are as it is please do something
Sep 16 '15 #10

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

Similar topics

49
14881
by: raju | last post by:
hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s
1
8269
by: hiteshmangal | last post by:
Hi, How I can compare 2 xml files using c#.net. Thanks, Hitesh
1
1641
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 previous record in the table, my question is how exactly do I compare rows in a datatable? I was going to solve the problem with SQL but the database is so poor that it just wasn't viable.
3
8667
by: fishjelly | last post by:
How to open new window through linkButton without using javacript?...
1
4716
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
1518
by: johnson1314310 | last post by:
duplicate rows occurring when using inner join,i want to join a table value to another table..
0
8498
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8940
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7458
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6251
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4237
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2833
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2084
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1831
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.