Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d0423c

Browse files
committed
enh wbraganca#24: Added support for jquery.inputmask. It only works with Yii 2.0.4 or higher.
1 parent cd89f84 commit 2d0423c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ yii2-dynamicform change Log
33

44
dev-master
55
----------
6+
- enh #24: Added support for "jquery.inputmask". It only works with Yii 2.0.4 or higher.
67
- enh: Remove "error/success" class css template to be cloned.
78
- bug: Fixes for: checkbox(), checkboxList(), radio() and radioList()
89

assets/yii2-dynamic-form.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,15 @@
319319
var _restoreSpecialJs = function(widgetOptions) {
320320
var widgetOptionsRoot = _getWidgetOptionsRoot(widgetOptions);
321321

322+
// "jquery.inputmask"
323+
var $hasInputmask = $(widgetOptionsRoot.widgetItem).find('[data-plugin-inputmask]');
324+
if ($hasInputmask.length > 0) {
325+
$hasInputmask.each(function() {
326+
$(this).inputmask('remove');
327+
$(this).inputmask(eval($(this).attr('data-plugin-inputmask')));
328+
});
329+
}
330+
322331
// "kartik-v/yii2-widget-datepicker"
323332
var $hasDatepicker = $(widgetOptionsRoot.widgetItem).find('[data-krajee-datepicker]');
324333
if ($hasDatepicker.length > 0) {

0 commit comments

Comments
 (0)