I created a dynamic form using Yii2 dynamic-form that contains kartik Select2 widget which has select2:select in pluginEvents property.
The dynamic form create normally the fields with their attributes. However, the jquery event are not created.
I solved the problem by registering select2 event using kvListenEvent().
I placed the registration on afterInsert() yii2-dynamic-form event.
Related
I have a dashboard built using dojo dijits. One of the dijit is dojo calendar widget.
In this dashboard I am embedding an iframe to it. I want to change the value of the calendar widget from within the iframe.
The issue is since it is not just about changing the text value in the input box of calendar dijit it is also about calling the on change event. So I am using the following
dijit.byId('dijit_form_DateTextBox_1').set('value', datFrom);
This way the value gets updated as well as the change event is fired.
Now since I want to do this from within the iframe I need to get reference to calendar dijit in parent HTML page.
If this is a simple Javascript I would have used following to get to that DOM Element and change the value.
const targetNode = $('#'+divId, window.parent.document)[0];
But since this is dojo so I am unable to get this as a dijit object. Is there a way to get dijit from Parent page
Since the dataTextBox is inside iframe, it's in different scope, and looks like you are not using dojo in AMD pattern.
What you could do is get the object from iFrame's contentWidow and call byID() like any other function, example
var _dijit = document.getElementById("iframeId").contentWindow.dijit;
var dateTextBox = _dijit.byId('dijit_form_DateTextBox_1');
dateTextBox.set('value', datFrom);
or better is, you just call a global reference your own function rather than taking reference of dijit.
I need help how to apply form validation in dynamic form using vue js
I suppose you are new to VueJS. Vue has a plugin vuelidate for dynamic validations for your forms. Kindly check the link below
https://vuelidate.js.org/#sub-installation
I have datatable which is created through columns and items array.
I want to create one anchor link in vuejs which will call component method on click. Also in the items array may be contains html which i want to bind to vuejs events.
Thanks.
I made a popup component that dynamically loads a content component regardless of type.
After RC4 it is impossible to inject components without adding them to the entryComponents list.
Is it possible to load components without specifying them in entryComponents?
Is it possible to load all components into entryComponents list dynamically and is it a good idea?
P.S. I don't see a point of them adding the entryComponents list
You do not need to add entryComponents to the popup component itself. You need to add entryComponents to the caller of the popup which probably injects the component to the popup
I want to create a dynamic Accordion, My usecase is like, On every click of a Action button I want to add 1 Accordion Item.
I am using JSF 2.0 and Richfaces 4.1.0 Final
Pls help me guys.
You would need to maintain a list of items in your managed bean. Then you could use a4j:repeat to iterate over this list in your jsf page and create a rich:accordionItem for each of element in the list. The action method for the button could add items to the list on the bean.