Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Does SPDisplayRelatedInfo Work With Normal Input Fields?

$
0
0
@ixwood

Take a look at the autocomplete documentation - specifically the 'source' option: http://api.jqueryui.com/autocomplete/

Take a look at autocomplete examples - specifically the one that uses remote data and JSONP source; 1) http://jqueryui.com/autocomplete/#remote | 2) http://jqueryui.com/autocomplete/#remote-jsonp(Although you will not get JSON data from SP with SPServices, if you get a good understanding of how it works in the demo, you will be able to implement this no problem)

The design is as follows:
  1. use autocomplete on the input field
  2. Set the source option to a function that retrieves values based on the few characters that the user entered.
    a. Alter the response from GetListItems the create the data structure (Array of Objects) that autcomplete expects.
No. 2 above is where the magic happens... You use SPServices to issue a GetListItems (probably setting the max item to 50 (you don't want thousands of records coming back)... The trick is to use the "<Contain>" CAML clause with the value the user entered... That will match anything in that column containing the charterers... As the user enters more characters, the more accurate the results will become.

Hope this helps..

Paul.

( Shameful plug: This widget I created may help: SPLookupField : http://purtuga.github.io/SPWidgets/ - it was created to address this exact need: filter through large lists... If you want to see specifically how I coded it using the design described above, look in the source HERE )

.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>