[EXTENSION] tokeninput Forum for the 'tokeninput' extension
Posted 22 March 2012 - 04:29 AM
The latest suggestions are:
1. Use a serialized array for the attribute's value (scoob.junior).
2. Use an array to map 'tokenValue' to 'propertyToSearch'. I had my concerns about performance for big arrays, but zmilan pointed out correctly that arrays need only contain elements for the values assigned to the attribute.
I prefer not to use serialized array for the simple reason that the data submitted by the widget is a string of values separated by 'tokenDelimiter' and as such the value should have the same format and not force the developer to do any conversions of the submitted data. If the developer requires another format, he will have to make the conversions, but in a consistent way, for both setting and reading the value.
Any thoughts, suggestions?
Posted 04 April 2012 - 02:20 AM
I like this extention what I looking for, Thanks to contribute but Im still confuse how to change textfield width ?
It is currently not possible and it will be added in the next version, but it is easy to implement:
- Add a public property htmlOptions to the TokenInput class
- In the function run(), pass the property as a third argument to the CHtml::activeTextField function call
Now you can pass an htmlOptions attribute to the widget as you would do with a normal active text field.
Posted 04 April 2012 - 11:14 PM
in TokenInput.php i add this line
public $ htmlOptions;
and run ();
CHtml :: activeTextField echo ($ this-> model, $ this-> attributes, $ this-> htmlOptions);
....... 'theme' => 'facebook', 'htmlOptions' => array ('style' => 'width: 10px;'), ), )); ........
I'd try to change facebook style https://github.com/l...input/issues/98 its not work too.
Posted 05 April 2012 - 02:37 AM
The correct answer is that the field width is defined through CSS. The easiest way to change it would be to copy one of the provided CSS files, make the required changes and pass its URL to the cssFile option of the widget.
Please take care of the fact that the plugin uses the theme option as a suffix to all CSS class names, so if you use 'token-input.css' as a base, the theme option must be empty (do not define it), but if you use 'token-input-facebook.css', then set theme to 'facebook'. You could also create your own theme by using its name as the suffix to the CSS class names.
Posted 30 May 2012 - 04:59 AM
02. comment out this line in jqueyr.tokeninput.js file (line 441)
//input_box.width(input_resizer.width() + 30);
03. empty your /assets folder
04. now textbox size will not change and remain to whatever size you have set in step-01