0

I'm trying to use your AutoComplete project to populate list values based on an identifier

1 - User populates PropertyID
2 - PropertyName and Property Address get autoPopulated from the master Property list

What would the REST Filter look like ?

Thanks in advance

1
  • How does user populates the PropertyID? By typing to a textbox? – XristosK Sep 14 '14 at 11:26
0

I'm not good in jquery, but the general idea is:

https://stackoverflow.com/questions/18160342/jquery-how-to-trigger-click-event-on-pressing-enter-key

http://msdn.microsoft.com/en-us/library/office/jj860569(v=office.15).aspx

$(document).ready(function() {

 $("#txtSearchProdAssign").keyup(function (e) {
  if (e.which == 13) {
    var PropertyID = $("#txtSearchProdAssign").val();
    fillpup(PropertyID);
  }

} 
});

fillup( fillpup(PropertyID)) {

$.ajax( {
                url:"http://dev/_api/Lists(guid'D42378B2-CD5A-4AF8-B6BD-47048B84D642')/items?&$filter=PropertyID eq '" + PropertyID+"'&$select=propertyname,propertyAddress",
                type:"GET",
                 headers: {
                    "accept": "application/json;odata=verbose",
                },
                success: function(data){ 
                $('#propertyname').val (data.d.results[0].propertyname);
                $('#propertyAddress').val (data.d.results[0].propertyAddress);

            }//success
                ,
                error: function(error){
                                    //llog(" Error:" + mythis.val());
                console.log(" Ajax error:" + JSON.stringify(error));
                        }//error
                });//ajax
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.