Forum


11:48

25/02/2013

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,""];
}
}},
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66