Now when you try to add more than specified tags it will show alert messages. We can use onTagLimitExceeded callback for this. This doesn’t allow the user to add tags more than the specific limit, but wait it also doesn’t show any appropriate message as well, this is where the callbacks come into the picture. This will limit the number of tags added by the user. Suggestions for auto complete tagLimit (integer) Tags which are added in the array of availableTags will be given as suggestions in auto-complete. I have found some really interesting ones which I have incorporated into my project. Various parameters can also be passed during the tag-it initialization. Also you can add various themes and do as many customizations as you want. You can find the working demo of it on this link. You can easily remove the tags by using backspace or by clicking at the cross icon beside the added tags. Also when you try to add any tag which you have already added it will highlight the tag and now allow to add you second time. Now all the tags written in the tags will come pre-loaded and you can add new tags as you want. Now create a view file, add the tags in the ul, give it an id and initialize the tag-it with this specific id only. If you are working with Rails 4, you need to rename the file from jquery-ui.css to jquery-ui.scss and to then change all the image URL path to asset-url in these files as follows background-image: asset-url("images/ui-icons_444444_256x240.png") Īfter this, copy jquery-ui.js and tag-it.js and require them in the following order in your manifest js file. Create a directory app/assets/images/images and paste all images files. Then copy jquery-ui.css, and from the jQuery UI folder and from the Tag it folder to your rails app and require them in you manifest CSS file in the following order.Īfter that copy all the images stored in the images folder in the jQuery UI folder. Installationįirst of all, you will need to download jQuery UI plugin files from here and tag-it plugin files from here. Also, it is very easy to integrate with rails app. JQuery tag-it is an excellent jQuery UI plugin with auto-complete support. So when any user searches for the mobile accessories we can show all the items related to this tag. Tagging makes it easy to group the items and also facilitates searching. these all can be commonly tagged as mobile accessories. Now if there are items such as earphones, power banks, data cables etc. there is an online shopping website which sells various items such as clothes, electronics, books, mobile accessories etc. Sometimes we come across situations where we need to add tags to some items e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |