Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
How to add a custome validation in JqGrid
25/02/2013
11:48
Avatar
vikram
New Member
Members
Forum Posts: 1
Member Since:
25/02/2013
sp_UserOfflineSmall Offline

I have to check that the record/name is present or not in the generated list means unique name. I have two column in which one is unique so while adding a new entry i need to check that the new name is present or not.

For this i m using the below code but it is not working. can anyne please help me out.

 custom:true,custom_func: function(value,colname){
          var flag = false;
          var allRowsInGrid=$("#editgrid").getGridParam("records");
          for(i=1;i<=allRowsInGrid;i++)
          {
              var rowId = $("#editgrid").getRowData(i);
              var ingredientName = rowId['ingredientName'];
              if(ingredientName == value)
              {
                  flag = true;
              }
         }
         if(flag == true)
              return [false,"Ingredient Name: The Ingredient Name supplied is already in use. Please provide a different Ingredient Name."];
         else
             return [true,""];
      }
      }}, 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
34 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information