A simple jQuery datepicker plugin. Datepicker v1.0.7. A simple jQuery datepicker plugin. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. To refresh your session.
SmartAdmin is a bootstrap web application that provides a suite of widgets and components for administration and dashboard systems.
2
1answer
How does Smart Admin include pages in to the Ajax version of the theme?
I am using the Smart Admin Theme Ajax version in a project, and I cannot figure out how template data gets added to the theme. There is a main index view and Page sections stored inside the ajax ...
Rohan4,94214 gold badges48 silver badges102 bronze badges
5
0answers
ERROR in Error during template compile of 'AppModule' Function calls are not supported in decorators but 'ChartModule' was called
I installed angular2-highcharts on my Angular Project, implemented that. Its working but in ng serve mode. But when I executed the command ng build --prod. I got the error :Error during template ...
3
0answers
How to fix: Angular 7 (SmartAdmin template) form validation stops working after navigation
I am trying to perform form validation on an angular 7 app that is using the Smart Admin Template (Theme from wrapbootstrap).My issue is that it is working as expected the first time the browser ...
2
0answers
Bootstrap SmartAdmin disable SmartForm validation
I'm working in a project built over the SmartAdmin bootstrap webapp that comes with some kind of form validation in a feature called SmartForm. I don't know what it uses behind the scenes to validate ...
DontVoteMeDown16k8 gold badges52 silver badges87 bronze badges
1
0answers
Access a parent component's method from <ng-content> in Angular5
Hi i am using an template for build my web app and in my template i'm using a component for datatable inside another component. I am sending a data as JSON to this component and it creates rows. I ...
1
0answers
How to add custom item by typing in SmartAdmin Multi Select?
I am using multi select control that allows to select multiple options. Multi select allow us to select and find any item from dropdownlist. My purpose is to add new item by typing it into multi ...
0
0answers
How to add zircon file nps.pfx to Reactjs
How to add zircon file zirconnps.pfx to ReactjsI am using admin template (SmartAdmin-1.9.0).I want to configure ssl for production applicationI don't know where to add the file (zirconnps.pfx)'...
0
0answers
ChangeDetectorRef.detectChanges() working for the first time when given in ngAfterViewChecked
I am working on a Angular 4 application that uses smartadmin template. I have a popup inside ng-formly.That popup is rendering a form using repeated section. On popup button click an error is beeing ...
0
0answers
Jarvis Widget inside a VueJS Component
I am working on a Laravel 5.7 application, that has a view with a Jarvis Widget [http://data.edwardsaquifer.org/widgets.php] inside of a VueJS component. However, I can't seem to get the Jarvis widget ...
McWayWeb9221 gold badge14 silver badges31 bronze badges
0
0answers
Jarvis widget bug in smartadmin template in rtl mode
I use Smartadmin template and Jarvis widget on my page.Jarvis widget not working in RTL mode on Smartadmin template. When I change LTR to RTL mode and change all items to left or right after that I ...
0
0answers
Datatables - How to hide columns (responsive)
My table is perfectly fetching data from my server and showing everything alright. But I'm trying to make it responsive so when the user is using a mobile/small device, it should hide the columns I ...
0
0answers
errors appear in console every time I install an npm package and than i have to restore a backup
I am using smartAdmin to build an application. Whenever i install any package from npm and than try to run the app with ng serve it starts giving errors and I am unable to solve these errors and ...
0
0answers
Vue Object does not allow datepicker Calendar to pop up
And I am trying to integrate my vue.js into the framework and facing some peculiar issues.I have the following html<div> <div> ...
Siddharth6,67611 gold badges67 silver badges113 bronze badges
0
0answers
Smart Admin add child row
I'm working with the smart admin bootstrap template however I'm not able to figure out how to add child rows on a datatable whenever I want to add additional information for a particular record. Does ...
0
0answers
All buttons and dropdown menu not working after put in iframe
I'm using C# and SmartAdmin to build my web page.Everything working fine until I put in iframe code.This is my codes:iframe src='@Url.Content('~/ReportViewer/...
153050per page
PermalinkAll your code in one place
GitHub makes it easy to scale back on context switching. Read rendered documentation, see the history of any file, and collaborate with contributors on projects across GitHub.
Sign up for free See pricing for teams and enterprises Find file Copy path
Cannot retrieve contributors at this time
<?php |
namespacesersidsmartadmin; |
useyiihelpersArrayHelper; |
useyiihelpersJson; |
classActiveFieldextendsyiiwidgetsActiveField |
{ |
/** |
* @inheritdoc |
*/ |
public$template='{label}n{beginWrapper}n{icon}n{input}n{tooltip}n{endWrapper}n{hint}n{error}'; |
/** |
* @var string the template for file input in default layout |
*/ |
public$fileInputTemplate='{label}n{beginWrapper}n{beginButton}{input}{contentButton}{endButton}{placeholder}n{endWrapper}n{hint}n{error}'; |
/** |
* @var string the template for hidden in default layout |
*/ |
public$hiddenTemplate='{input}'; |
/** |
* @var string the template for checkbox list in default layout |
*/ |
public$checkboxListTemplate='{label}n{input}n{hint}n{error}'; |
/** |
* @var string the template for checkbox list toggles in default layout |
*/ |
public$checkboxListTogglesTemplate='{label}n{input}n{hint}n{error}'; |
/** |
* @var string the template for radio list in default layout |
*/ |
public$radioListTemplate='{label}n{input}n{hint}n{error}'; |
/** |
* @var string the template for radio in default layout |
*/ |
public$radioTemplate='{label}n{input}n{hint}n{error}'; |
/** |
* @var string the template for checkbox in default layout |
*/ |
public$checkboxTemplate='{label}n{input}n{hint}n{error}'; |
/** |
* @var string the template for radio list toggles in default layout |
*/ |
public$radioListTogglesTemplate='{label}n{input}n{hint}n{error}'; |
/** |
* @inheritdoc |
*/ |
public$inputOptions= []; |
/** |
* @inheritdoc |
*/ |
public$labelOptions= ['class'=>'label']; |
/** |
* @inheritdoc |
*/ |
public$hintOptions= ['class'=>'note']; |
/** |
* Wrapper options |
* @var array |
*/ |
public$wrapperOptions= []; |
/** |
* Icon |
* @var string |
*/ |
public$icon; |
/** |
* Icon options |
* @var array |
*/ |
public$iconOptions= []; |
/** |
* Tooltip |
* @var string |
*/ |
public$tooltip; |
/** |
* Tooltip options |
* @var array |
*/ |
public$tooltipOptions= []; |
/** |
* @var bool whether to render [[checkboxList()]] and [[radioList()]] inline. |
*/ |
public$inline=false; |
/** |
* @var bool whether to render [[textarea()]] resizable. |
*/ |
public$resizable=false; |
/** |
* @var bool whether to render [[textarea()]] expandable. |
*/ |
public$expandable=false; |
/** |
* @inheritdoc |
*/ |
publicfunctioninit() |
{ |
parent::init(); |
$this->options['tag'] =isset($this->options['tag']) ? $this->options['tag'] : 'section'; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctionrender($content=null) |
{ |
if ($contentnull) { |
$this->_renderWrapper(); |
$this->_renderIcon(); |
$this->_renderTooltip(); |
if (!isset($this->parts['{input}'])) { |
$this->textInput(); |
} |
} |
returnparent::render($content); |
} |
/** |
* Render wrapper |
*/ |
privatefunction_renderWrapper() |
{ |
if (!isset($this->parts['{beginWrapper}'])) { |
$options=$this->wrapperOptions; |
$tag=ArrayHelper::remove($options, 'tag', 'label'); |
if (!isset($options['class'])) { |
$options['class'] ='input'; |
} |
$this->parts['{beginWrapper}'] =Html::beginTag($tag, $options); |
$this->parts['{endWrapper}'] =Html::endTag($tag); |
} |
} |
/** |
* Render icon |
*/ |
privatefunction_renderIcon() |
{ |
if (!isset($this->parts['{icon}'])) { |
if (empty($this->icon)) { |
$this->parts['{icon}'] =''; |
return; |
} |
$options=$this->iconOptions; |
$position=ArrayHelper::remove($options, 'position', Html::ICON_APPEND); |
if (in_array($position, [Html::ICON_APPEND, Html::ICON_PREPEND])) { |
Html::addCssClass($options, $position); |
} |
$this->parts['{icon}'] =Html::icon($this->icon, $options); |
} |
} |
/** |
* Render icon |
*/ |
privatefunction_renderTooltip() |
{ |
if (!isset($this->parts['{tooltip}'])) { |
if (empty($this->tooltip)) { |
$this->parts['{tooltip}'] =''; |
return; |
} |
$options=$this->tooltipOptions; |
Html::addCssClass($options, 'tooltip'); |
$position=ArrayHelper::remove($options, 'position', Html::TOOLTIP_TOP_RIGHT); |
if (in_array($position, [ |
Html::TOOLTIP_BOTTOM_LEFT, |
Html::TOOLTIP_BOTTOM_RIGHT, |
Html::TOOLTIP_LEFT, |
Html::TOOLTIP_RIGHT, |
Html::TOOLTIP_TOP_LEFT, |
Html::TOOLTIP_TOP_RIGHT, |
])) { |
Html::addCssClass($options, $position); |
} |
$tag=ArrayHelper::remove($options, 'tag', 'b'); |
$this->parts['{tooltip}'] =Html::tag($tag, $this->tooltip, $options); |
} |
} |
/** |
* Set wrapper options |
* @param array $options |
* @param string $class |
*/ |
privatefunction_setWrapperOptions(&$options= [], $class='input') |
{ |
$this->wrapperOptions=array_merge($this->wrapperOptions, ArrayHelper::remove($options, 'wrapperOptions', [])); |
Html::addCssClass($this->wrapperOptions, $class); |
$attribute=Html::getAttributeName($this->attribute); |
/*if ($this->model->hasErrors($attribute)) { |
Html::addCssClass($this->wrapperOptions, 'state-error'); |
}*/ |
} |
/** |
* Set icon |
* @param array $options |
*/ |
privatefunction_setIconOptions(&$options) |
{ |
$this->icon=ArrayHelper::remove($options, 'icon'); |
$this->iconOptions=array_merge($this->iconOptions, ArrayHelper::remove($options, 'iconOptions', [])); |
} |
/** |
* Set tooltip |
* @param array $options |
*/ |
privatefunction_setTooltipOptions(&$options) |
{ |
$this->tooltip=ArrayHelper::remove($options, 'tooltip'); |
$this->tooltipOptions=array_merge($this->tooltipOptions, ArrayHelper::remove($options, 'tooltipOptions', [])); |
} |
/** |
* @inheritdoc |
*/ |
publicfunctioninput($type, $options= []) |
{ |
if($type'hidden') { |
return$this->hidden($options); |
} |
$options=array_merge($this->inputOptions, $options); |
$this->_setWrapperOptions($options); |
$this->_setIconOptions($options); |
$this->_setTooltipOptions($options); |
returnparent::input($type, $options); |
} |
/** |
* Hidden input |
* @param array $options |
* @return sersidsmartadminActiveField |
*/ |
publicfunctionhidden($options= []) |
{ |
$this->template=$this->hiddenTemplate; |
returnparent::input('hidden', $options); |
} |
/** |
* @inheritdoc |
*/ |
publicfunctiontextInput($options= []) |
{ |
$options=array_merge($this->inputOptions, $options); |
$this->_setWrapperOptions($options); |
$this->_setIconOptions($options); |
$this->_setTooltipOptions($options); |
returnparent::textInput($options); |
} |
/** |
* @inheritdoc |
*/ |
publicfunctionpasswordInput($options= []) |
{ |
$options=array_merge($this->inputOptions, $options); |
$this->_setWrapperOptions($options); |
$this->_setIconOptions($options); |
$this->_setTooltipOptions($options); |
returnparent::passwordInput($options); |
} |
/** |
* @inheritdoc |
*/ |
publicfunctionfileInput($options= []) |
{ |
$options=array_merge($this->inputOptions, $options); |
$options['wrapperOptions']['tag'] =isset($options['wrapperOptions']) &&isset($options['wrapperOptions']['tag']) ? $options['wrapperOptions']['tag'] : 'div'; |
$this->_setWrapperOptions($options, 'input input-file'); |
// Set template |
$this->template=$this->fileInputTemplate; |
// Button |
$btnOptions=ArrayHelper::remove($options, 'buttonOptions', []); |
$btnTag=ArrayHelper::remove($btnOptions, 'tag', 'span'); |
$btnContent=ArrayHelper::remove($btnOptions, 'content', 'Browse'); |
Html::addCssClass($btnOptions, 'button'); |
$this->parts['{beginButton}'] =Html::beginTag($btnTag, $btnOptions); |
$this->parts['{contentButton}'] =$btnContent; |
$this->parts['{endButton}'] =Html::endTag($btnTag); |
// Placeholder input |
$phrOptions=ArrayHelper::remove($options, 'placeholderOptions', []); |
$phrOptions['readonly'] ='readonly'; |
$placeholder=ArrayHelper::remove($options, 'placeholder'); |
if ($placeholder!null) { |
$phrOptions['placeholder'] =$placeholder; |
} |
$this->parts['{placeholder}'] =Html::input('text', null, null, $phrOptions); |
// Onchange |
$onchange='this.parentNode.nextSibling.value = this.value'; |
$options['onchange'] =isset($options['onchange']) ? $options['onchange'] : $onchange; |
returnparent::fileInput($options); |
} |
/** |
* @inheritdoc |
*/ |
publicfunctiontextarea($options= []) |
{ |
$options=array_merge($this->inputOptions, $options); |
$this->_setWrapperOptions($options, 'textarea'); |
$this->_setIconOptions($options); |
$this->_setTooltipOptions($options); |
if (ArrayHelper::remove($options, 'resizable') ||$this->resizable) { |
Html::addCssClass($this->wrapperOptions, 'textarea-resizable'); |
} |
if (ArrayHelper::remove($options, 'expandable') ||$this->expandable) { |
Html::addCssClass($this->wrapperOptions, 'textarea-expandable'); |
} |
Html::addCssClass($options, 'custom-scroll'); |
returnparent::textarea($options); |
} |
/** |
* @inheritdoc |
*/ |
publicfunctiondropDownList($items, $options= []) |
{ |
$options=array_merge($this->inputOptions, $options); |
$this->_setWrapperOptions($options, 'select'); |
$this->_setIconOptions($options); |
$this->_setTooltipOptions($options); |
if (isset($options['multiple'])) { |
Html::addCssClass($this->wrapperOptions, 'select-multiple'); |
Html::addCssClass($options, 'custom-scroll'); |
} |
parent::dropDownList($items, $options); |
$this->parts['{input}'] .=isset($options['multiple']) ? '' : '<i></i>'; |
return$this; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctioncheckboxList($items, $options= []) |
{ |
$this->template=$this->checkboxListTemplate; |
$options=array_merge($this->inputOptions, $options); |
if (ArrayHelper::remove($options, 'inline') ||$this->inline) { |
Html::addCssClass($options, 'inline-group'); |
} |
$this->adjustLabelFor($options); |
$this->parts['{input}'] =Html::activeCheckboxListSmart($this->model, $this->attribute, $items, $options); |
return$this; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctioncheckboxListToggles($items, $options= []) |
{ |
$this->template=$this->checkboxListTogglesTemplate; |
$options=array_merge($this->inputOptions, $options); |
$options['itemOptions']['iconOptions']['data-swchon-text'] =ArrayHelper::remove($options, 'onText', 'ON'); |
$options['itemOptions']['iconOptions']['data-swchoff-text'] =ArrayHelper::remove($options, 'offText', 'OFF'); |
$this->adjustLabelFor($options); |
$this->parts['{input}'] =Html::activeCheckboxListSmartToggles($this->model, $this->attribute, $items, $options); |
return$this; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctionradioList($items, $options= []) |
{ |
$this->template=$this->radioListTemplate; |
$options=array_merge($this->inputOptions, $options); |
if (ArrayHelper::remove($options, 'inline') ||$this->inline) { |
Html::addCssClass($options, 'inline-group'); |
} |
$this->adjustLabelFor($options); |
$this->parts['{input}'] =Html::activeRadioListSmart($this->model, $this->attribute, $items, $options); |
return$this; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctioncheckbox($options= [], $enclosedByLabel=true) |
{ |
$this->template=$this->checkboxTemplate; |
Html::addCssClass($options['labelOptions'], 'checkbox'); |
if ($enclosedByLabel) { |
$this->parts['{input}'] =Html::activeCheckboxSmart($this->model, $this->attribute, $options); |
$this->parts['{label}'] =''; |
} else { |
if (isset($options['label']) &&!isset($this->parts['{label}'])) { |
$this->parts['{label}'] =$options['label']; |
if (!empty($options['labelOptions'])) { |
$this->labelOptions=$options['labelOptions']; |
} |
} |
unset($options['labelOptions']); |
$options['label'] =null; |
$this->parts['{input}'] =Html::activeCheckboxSmart($this->model, $this->attribute, $options); |
} |
$this->adjustLabelFor($options); |
return$this; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctionradio($options= [], $enclosedByLabel=true) |
{ |
$this->template=$this->radioTemplate; |
Html::addCssClass($options['labelOptions'], 'radio'); |
if ($enclosedByLabel) { |
$this->parts['{input}'] =Html::activeRadioSmart($this->model, $this->attribute, $options); |
$this->parts['{label}'] =''; |
} else { |
if (isset($options['label']) &&!isset($this->parts['{label}'])) { |
$this->parts['{label}'] =$options['label']; |
if (!empty($options['labelOptions'])) { |
$this->labelOptions=$options['labelOptions']; |
} |
} |
unset($options['label'], $options['labelOptions']); |
$this->parts['{input}'] =Html::activeRadioSmart($this->model, $this->attribute, $options); |
} |
$this->adjustLabelFor($options); |
return$this; |
} |
/** |
* @inheritdoc |
*/ |
publicfunctionradioListToggles($items, $options= []) |
{ |
$this->template=$this->radioListTogglesTemplate; |
$options=array_merge($this->inputOptions, $options); |
$options['itemOptions']['iconOptions']['data-swchon-text'] =ArrayHelper::remove($options, 'onText', 'ON'); |
$options['itemOptions']['iconOptions']['data-swchoff-text'] =ArrayHelper::remove($options, 'offText', 'OFF'); |
$this->adjustLabelFor($options); |
$this->parts['{input}'] =Html::activeRadioListSmartToggles($this->model, $this->attribute, $items, $options); |
return$this; |
} |
/** |
* Datalist input |
* @param array $items |
* @param array $options |
* @return sersidsmartadminActiveField |
*/ |
publicfunctiondatalist($items, $options= []) |
{ |
$options=array_merge($this->inputOptions, $options); |
$this->_setWrapperOptions($options); |
$this->_setIconOptions($options); |
$this->_setTooltipOptions($options); |
$this->adjustLabelFor($options); |
if (!array_key_exists('id', $options)) { |
$id=Html::getInputId($this->model, $this->attribute); |
} |
$listId=$id.'-list'; |
$options['list'] =$listId; |
$datalistOptions=ArrayHelper::remove($options, 'datalistOptions', []); |
$datalistOptions['id'] =array_key_exists('id', $datalistOptions) ? $datalistOptions['id'] .''.$listId : $listId; |
$this->parts['{input}'] =Html::activeTextInput($this->model, $this->attribute, $options) . |
Html::tag('datalist', Html::renderSelectOptions(null, $items, $datalistOptions), $datalistOptions); |
return$this; |
} |
/** |
* Size of input |
* @param string $size |
* @return sersidsmartadminActiveField |
*/ |
publicfunctionsize($size) |
{ |
Html::addCssClass($this->inputOptions, $size); |
return$this; |
} |
/** |
* @param bool $value whether to render a inline list |
* @return static the field object itself |
* Make sure you call this method before [[checkboxList()]] or [[radioList()]] to have any effect. |
*/ |
publicfunctioninline($value=true) |
{ |
$this->inline= (bool) $value; |
return$this; |
} |
/** |
* @param bool $value whether to render a resizable textarea |
* @return static the field object itself |
* Make sure you call this method before [[textarea()]] to have any effect. |
*/ |
publicfunctionresizable($value=true) |
{ |
$this->resizable= (bool) $value; |
return$this; |
} |
/** |
* @param bool $value whether to render a expandable textarea |
* @return static the field object itself |
* Make sure you call this method before [[textarea()]] to have any effect. |
*/ |
publicfunctionexpandable($value=true) |
{ |
$this->expandable= (bool) $value; |
return$this; |
} |
/** |
* Alias of hint |
* @see yiiwidgetsActiveField::hint($content, $options); |
*/ |
publicfunctionnote($content, $options=array()) |
{ |
returnparent::hint($content, $options); |
} |
/** |
* Set icon |
* @param string $name |
* @param array $options |
* @return sersidsmartadminActiveField |
*/ |
publicfunctionicon($name, $options=array()) |
{ |
$this->icon=$name; |
$this->iconOptions=array_merge($this->iconOptions, $options); |
return$this; |
} |
/** |
* Set tooltip |
* @param string $content |
* @param array $options |
* @return sersidsmartadminActiveField |
*/ |
publicfunctiontooltip($content, $options=array()) |
{ |
$this->tooltip=$content; |
$this->tooltipOptions=array_merge($this->tooltipOptions, $options); |
return$this; |
} |
/** |
* Create date picker |
* @param array $options |
* @return $this |
*/ |
publicfunctiondatepicker($options= []) |
{ |
$view=$this->form->getView(); |
if (array_key_exists('id', $options)) { |
$id=$options['id']; |
} else { |
$id=Html::getInputId($this->model, $this->attribute); |
} |
$jsParams=Json::encode($options); |
$view->registerJs('jQuery('#$id').datepicker($jsParams);'); |
return$this; |
} |
} |
Copy lines Copy permalink