HZNM.COM
welcome to my space
X
Search:  
 HOME   How to validate for duplicate records in Grid?
How to validate for duplicate records in Grid?
Published by: anonym 2009-01-08
Welcome to:hznm.com

  • Hi,
    I have a grid where I need to validate for duplicate records. I have used two for loops, the first loop gets the modified records and compares with the store.

    The problem is even the store is having newly added record before committing.

    Any ideas on how to avoid duplicate records is appreciated.


    {text:'Save',
    tooltip:'Save',
    iconCls:'save',
    id: 'save',
    disabled :true,
    handler: function(){
    var mrecords=dropDownGridStore.getModifiedRecords();
    var flag = false;
    var duplicateFlag = false;
    var store = dropDownGrid.getStore();
    var size = store.getCount();
    var record = store.getAt(cnt);
    var dropdownvalue1 = "";

    //Validating for blank record
    for(var count=0;count var dropDownVal=mrecords[count].get('dropDownValues');
    dropDownVal=dropDownVal.replace(/^ss*/, '').replace(/ss*$/, '');
    Electronic Code of Federal Regulations:::
    Appendix A to Subpart E of Part 763—Interim Transmission (a) Records required under this section shall be maintained in a centralized location in the
    http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr&rgn=dde=40:30.0.1.1.18&idno=40
    HOME
    Subscribe / Unsubscribe to a Mailing List - FlashDen::
    Advanced email validation. Restricts duplicate email entry. Sends HTML I believe you can also restrict duplicate records on the mySQL side as well, if
    http://flashden.net/item/subscribe-unsubscribe-to-a-mailing-list/14567ref=fisch79
    HOME
    if(dropDownVal==''){
    comp.databases.ms-access [Archive] - dbTalk Databases Forums::
    Use of Max in query grid (2 replies) Run as is it possible ? Summarizing values for duplicate records (1 replies) Function to count workdays (18 replies)
    http://www.dbtalk.net/archive/77-2005-8-1.php
    HOME
    Access Tips::
    One way to delete duplicate records in Access is to create a new table which Using Validation Rules to Restrict Data in Microsoft Access
    http://www.createthefuture.com/access.htm
    HOME
    Ext.MessageBox.alert('Error','Blank value is not allowed. Please enter a dropdown value.');
    flag = true;
    break;
    }

    //Validate for Duplicate records
    for(var cnt=0;cnt record = store.getAt(cnt)
    dropdownvalue1 = record.get('dropDownValues');
    dropdownvalue1=dropdownvalue1.replace(/^ss*/, '').replace(/ss*$/, '');
    if(dropDownVal.toLowerCase()==dropdownvalue1.toLow erCase()){
    duplicateFlag=true;
    Ext.MessageBox.alert('Error','You have entered Dropdown Value "'+dropdownvalue1+'" which already exists in the list.
    Duplicate values are not allowed');
    break;
    }
    }
    }
    if(!flag && !duplicateFlag){
    var jsonData = updateDB(mrecords);
    Ext.Ajax.request({
    url: 'saveDropDownData.action',
    params: {jData:jsonData,codeType:dropDownName.getValue()},
    waitMsg:'Saving...',
    success: function(response, request){
    var result = Ext.decode(response.responseText);
    if(result.success=='true'){
    Ext.MessageBox.hide();
    Ext.MessageBox.show({
    title: 'Save',
    msg: "Your data changes have been saved successfully.",
    buttons: Ext.Msg.OK,
    closable:false,
    animEl: 'elId',
    icon: Ext.MessageBox.INFO
    });
    //Modified to store the node list to dropdown
    dropDownGridStore.commitChanges();
    dropDownGridStore.load({
    params: {'moduleName': moduleNames.getValue(),'codeType':dropDownName.get Value()}
    });
    } else {
    Ext.MessageBox.show({
    title: 'Error',
    msg: "Error in saving the records. " + result.msg,
    buttons: Ext.Msg.OK,
    closable:false,
    animEl: 'elId',
    icon: Ext.MessageBox.INFO
    });
    }
    }

    });
    }
    }
    }


    Regards,
    SURESH


  • i just loop through the store and look for a specific value like an ID or something.





  • How much does getting a small tattoo on your hip/stomach hurt?
    Do anyone else have an itchy anus? ?

    You are looking at:hznm.com's How to validate for duplicate records in Grid?, click hznm.com to home
  • i have dark brown hair and i have no idea on what highlights to do any ideas
  • where should we vacation in mid december driving distance from richmond va
  • is it safe to drink the water in japan if i 039 m from minnesota
  • what would a rep do if there was an advertised sauna and gym but they did not exist in the hotel
  • does it ever rain in the philippines
  • was he waiting for me 2 ask him out
  • why are there relatively few people who are going to travel japan tell me reasons you don 039 t choose japan
  • what is the capital of the philippines
  • is he playing games with me
  • i want to dye my own hair
  • visiting canada from usa
  • where should i live in the chicago area
  • what are jackson hole burgers like and are they takeaway
  • how long will it take to get from jfk to the city
  •  
  • where is the best place to live on the ny nj border
  • i want to go to baguio how do i commute
  • is this supposed to be funny
  • im thinking of moving to spain and would like some opinions
  • would you rather live in constant fear
  • what 039 s highway 80 like from reno to elko
  • ladies what do you think of pot bellied guys at the beach
  • which is reasonable ya usa or ya japan
  • what 039 s your favourite saying proverb can you mention some
  • magic witchcraft spells
  • does it ever snow in the philippines
  • for the feminists who say
  • help me with ryanair
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 hznm.com        Site made:CFZ