kartik-v / yii2-widgets

Collection of useful widgets for Yii Framework 2.0
http://demos.krajee.com/widgets
Other
558 stars 177 forks source link

How to reinitialize via js plugin of Kartik? #388

Open strtob opened 1 year ago

strtob commented 1 year ago

Hi,

I use this awesome kartik tools!

For serveral times, by using e.g. datecontrol or in the current case maskedinput I ask myself, how to reinitalize the plugins via js. In the following example, I change the mask via js. I've understood, that the name of the object containing the information for an input is stored in data-plugin-inputmask. I suggest I have to change the mask information and have to refresh the input field, but does this go?

        var inputField = $("#entitymasterdata-value_text");
        pluginInputMask = inputField.data('plugin-inputmask');
        pluginInputMask.mask = $type.find(':selected').data('hastextformat');