Yii2 Widgets Extension

Thanks, Great!

Can you please give an example of how to use the FileInput, not only in the view side, but also in the controller and the form model?

In addition, are there plans for adding time picker?

Thanks

Zvi.

The FileInput widget only captures the file input. For using it within Yii model and controller to carry out an upload, you must use something like \yii\web\UploadedFile. You can refer this wiki and yet another detailed article for Yii 1.x on using this with a model and it should not drastically change for Yii 2.x. But you can refer the UploadedFile code documentation for Yii 2 and find this out - which should support multiple files. I will try to maybe create a wiki later when I have time. In case, you do manage to do this, it will be great for you to share with all here.

Will try and add it when I have time :). Noting this.

[size="4"]DatePicker[/size] upgraded to latest plugin version. Multiple Date Selection is now possible. Check the last example on the demos page.

New [size="4"]TimePicker[/size] widget added. The TimePicker widget allows you to easily select a time for a text input using your mouse or keyboards arrow keys. Check the usage and demos for this widget.

Enhancements to the [size="4"]ActiveForm [/size]widget. The formConfig property can control display of both errors and labels (especially useful for inline type forms).

Refer details here.

Various additions and enhancements to [size="4"]HTML-5 Inputs[/size]. In addition to enhancements to ActiveField [size="4"][font="Courier New"]input($type, $options)[/font][/size].

Refer details here or view a complete demo.

New widgets [size="4"]ColorInput[/size] and [size="4"]RangeInput[/size] added. These are based on HTML 5 inputs and styled for Twitter Bootstrap 3.

New widget [size="4"]SwitchInput[/size] added and styled for Twitter Bootstrap 3. The SwitchInput widget turns checkboxes and radio buttons list into toggle switches.

New widget [size="4"]StarRating[/size] added styled for Twitter Bootstrap 3. The StarRating widget is a wrapper for the Bootstrap Star Rating Plugin JQuery Plugin designed by Krajee. This plugin is a simple yet powerful JQuery star rating plugin for Twitter Bootstrap. Developed with a focus on utlizing pure CSS-3 styling to render the control.

The [size="4"]ColorInput[/size] widget has been upgraded & enhanced to use the Spectrum JQuery Plugin (which is an advanced color picker using pure CSS and JQuery - no images). You have an option to use the native HTML5 color input (which is not supported in all browsers). The plugin automatically polyfills for input type="color" if browser does not support it.

Specially styled for Bootstrap 3.x.

View details and demo.

Thanks for this awesome extention. i really like your grid view widget. and i use it, i’m still learn about yii2. i need to export grid view data to csv, can you give me some theory how to get array of data from grid view and export it to csv. thanks alot

Have bug in kartik SideNav widget:

PHP Fatal Error – yii\base\ErrorException

Class ‘yii\helpers\Url’ not found

One method is to use PHP Excel and read directly from data-provider to generate output.

Your yii install seems to be outdated. Run composer update to upgrade.

The extension has been updated to version 2.1.0. New changes:

[list=1]

[*]Widgets categorized into groups. Refer details here.

  • Input Widgets

  • Progress Widgets

  • Navigation Widgets

[*]Added [size="4"]DateTimePicker[/size] widget enhanced for Bootstrap 3.x. Refer details and demo.

[*]Added [size="4"]Spinner[/size] widget based on spin.js - an animated CSS3 loading spinner with VML fallback for IE. Refer details and demo.

[/list]

Hi K.,

is there an example of typeahead widget (view/controller)?

It is difficult to understand how to pass the query param.

Thanks

Fourth category of widgets added: Notification widgets.

Consists of these new widgets:

  • Alert: Extends the [font="Courier New"]\yii\bootstrap\Alert[/font] widget with more styling options and fade out controls. Refer the interactive demo.

  • Growl: Builds upon the bootstrap growl plugin to render growl like notifications - with numerous configuration options.

  • AlertBlock: Group alerts in a block with automatic fade delay dependencies. This is an enhanced version of the Alert widget in advanced app — you can use this widget typically in your view layout file to read session message flashes and render them using the Alert or Growl widget types. You can also fade out alerts, and use various styling options provided by the 2 widgets.

FileInput does not work properly when loaded via Ajax (for example in a modal window), appear like a normal file input button.

Is it a problem of javascript?

Looks like that’s the case. Depends on how you are loading the file-input widget in your ajax call? One or both of the following could be a reason and should be checked:

  1. Are your assets (fileinput.js & css) available to the new view/modal dialog after the the ajax call? You may want to call FileInputAsset::register($this) in the view file again if needed.

  2. It also looks probable that the JQuery fileinput session is destroyed and you may need to reinitialize the file input.

To re-initialize the fileinput widget you may call the following javascript after your ajax operation is complete:




$("#input-id").fileinput(options); 

// where options is the settings for your fileinput plugin - or you can 

// set these through data- attributes to avoid passing again



Ok, re-initialization is needed, solved with your code




$("#input-id").fileinput(options);