Jump to content

Richiamare valore "riferimento" nel file jquery.autocomplete.js


freuxbang

Recommended Posts

Salve, quando entro dentro un ordine e clicco su aggiungi prodotto, nella tendina che mi spunta dopo aver inserito le iniziali del prodotto, vorrei che mi spuntasse, oltre al nome, anche il riferimento.

 

Il file in js che compila la tendina con sfondo grigio scuro, è il file jquery.autocomplete.js  e precisamente la funzione è: 

function fillList() {
		list.empty();
		var max = limitNumberOfItems(data.length);
		for (var i=0; i < max; i++) {
			if (!data[i])
				continue;
			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term) ;
			if ( formatted === false )
				continue;
			var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
			$.data(li, "ac_data", data[i]);
		}
		listItems = list.find("li");
		if ( options.selectFirst ) {
			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
			active = 0;
		}
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			list.bgiframe();
	}

pensavo di sostituire questa variabile che in teoria stampa i nomi dei prodotti:

var formatted = options.formatItem(data.data, i+1, max, data.value, term) ;

in

var formatted = options.formatItem(data.data, i+1, max, data.value, term) + 'valore riferimento' ;

 

Ma come posso recuperare il valore del riferimento?

 

Grazie mille

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...