Jquery Token Input if there is no option

$("#IdMRuangan").tokenInput(site+"master_ruangan/get_all", {
		resultsFormatter: function(item) {	
			 return "<li>" + item.name +"</li>" ;
		},
		preventDuplicates: true,
		//hintText: "Disposisi Surat dikirim kepada ?",
		noResultsText: "O Hasil",
		searchingText: "Mencari...",
                resizeInput: false,
                tokenLimit:1,
		animateDropdown: false,
                onResult: function (item) {
                    if($.isEmptyObject(item)){
                          $("#MRuangan").val($("#token-input-IdMRuangan").val());
                          return [{id: $("#token-input-IdMRuangan").val(),
                                   name: $("#token-input-IdMRuangan").val()}]
                    }else{
                          return item
                    }
                }
    });

One Response to Jquery Token Input if there is no option

  1. xbox live kody z allegro says:

    Can I simply just say what a relief to uncover somebody that really understands what they are discussing on the web.

    You actually understand how to bring an issue to light and make
    it important. A lot more people should look at this and understand this side of the story.
    It’s surprising you are not more popular since you most certainly
    possess the gift.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: