Tagging support implementation

1 reply · opened Sep 4, 2017

FFlyingZipperSep 4, 2017

I have included the following files in my framework (Yii2)

'canvas-theme\canvas-css\css\components\select-boxes.css',

'canvas-theme\canvas-js\js\jquery.js',
'canvas-theme\canvas-js\js\components\select-boxes.js',
'canvas-theme\canvas-js\js\components\selectsplitter.js',
'canvas-theme\canvas-js\js\can-function.js',

but the Tagging Support in http://themes.semicolonweb.com/html/canvas/component-select-box.php doesn't work proprely with the following code :

					
							
								Tagging Support
								
									orange
									white
									purple
									red
									blue
									green
								
- 
							
FFlyingZipperSep 4, 2017

Fixed it... If you encounter the same problem as I did :

Include this file this script :

jQuery(document).ready( function($){

			// Multiple Select
			$(".select-1").select2({
				placeholder: "Select Multiple Values"
			});

			// Loading array data
			var data = [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }];
			$(".select-data-array").select2({
			  data: data
			})
			$(".select-data-array-selected").select2({
			  data: data
			});

			// Enabled/Disabled
			$(".select-disabled").select2();
			$(".select-enable").on("click", function () {
				$(".select-disabled").prop("disabled", false);
				$(".select-disabled-multi").prop("disabled", false);
			});
			$(".select-disable").on("click", function () {
				$(".select-disabled").prop("disabled", true);
				$(".select-disabled-multi").prop("disabled", true);
			});

			// Without Search
			$(".select-hide").select2({
				minimumResultsForSearch: Infinity
			});

			// select Tags
			$(".select-tags").select2({
				tags: true
			});

			// Select Splitter
			$('.selectsplitter').selectsplitter();

		});

And when you include the html tagging support implement it like this :

                            
                              
                                Tagging Support
                                
                                    orange
                                    white
                                    purple
                                    red
                                    blue
                                    green
                                
                            
                          

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard