Hi,
Can you please look at this issue.
TypeError Cannot read properties of undefined (reading ‘val’)
<template>
<JqxForm ref="myForm" :template="template"> </JqxForm>
</template>
<script>
import JqxForm from "jqwidgets-scripts/jqwidgets-vue/vue_jqxform.vue";
import data from "./assets/data.json"; //import json data
export default {
components: {
JqxForm,
},
mounted: function () {
const myForm = this.$refs.myForm;
const btn = myForm.getComponentByName("btn");
btn.on("click", function () {
if (typeof myForm.getComponentByName("xxxx") !== "undefined") {
//set the input value to the data
myForm.getComponentByName("xxxx").val("data");
}
});
},
data: function () {
return {
template: [
{
bind: "xxxx",
type: "label",
label: "some label",
labelPosition: "left",
labelWidth: "30%",
align: "left",
width: "250px",
},
{
name: "btn",
type: "button",
text: "btn",
align: "left",
padding: { left: 0, top: 5, bottom: 5, right: 40 },
},
],
};
},
};
</script>
Thanks.