Hi,
We are using DashboardLayout, we use template in <e-panl>, we like to access methons defined in template, how can we access it? please help us.
Below is what we try in our project.
<ejs-dashboardlayout ref="dashbordInstance"
:cellSpacing="spacing" :columns="24" allowResizing="true" :key="chartkey"
:resizeStop="onPanelResize" >
<e-panels>
<e-panel ref="refdtPctChart" :key="chartkey" :row="0" :col="0" :sizeX="4" :sizeY="1" :content="dtPctChart"></e-panel>
<e-panel :key="chartkey" :row="0" :col="4" :sizeX="4" :sizeY="1" content="<div>1</div>"></e-panel>
<e-panel :key="chartkey" :row="0" :col="8" :sizeX="4" :sizeY="1" content="<div>2</div>"></e-panel>
dtPctChart(){
return {
template : CircleChartTemplate
}
}
2. CircleChartTemplate.vue
methods: {
test(){
}
},
when we try to access method "test" from Main.vue by using
it doesn't work, this.$refres.refdtPct is undefined.
Thanks,
CZ
|
<CircleChartTemplate ref="refdtPctChart" />
...
this.$refs.refdtPctChart.test(); |
Hi Indhumathy,
You don't answer the question, my question is
How can I access the method inside a child component page in a parent component, for my example In want to access methods defined in CircleChartTemplate.vue from its parament Main.vue, it should be in the method of Main.vue can call the method in CircleChartTemplate.vue, can you give me an eample?
Thanks,
CZ
Hi Shameer Ali Baig S,
Thank you for your information.
I read the sample and It should work although I don't have time to test in our project right now,
I am working on putting more than 20 ejs-accumulationchart, ejs-chart, ejs-grid in
ejs-dashboardlayout dynamically right now, there are a lot of challenge to finish the project on time, if I have question, I will consult you.
Thank you for your support!
Thanks,
CZ
Hi Keerthana R,
Thank you for your support.
In our application,
(1) We have multiple ejs-accumulationcharts, x position of one annotation "DT" should be show on the right corner, how to make its position is dynamically changed to right position when we resize this component?
below is our project result. we can't get the box size during the create session, we have to use x: '85px', it should not be hard code,
Below is our sample code, charname and valuepct are props, its value are "DT" and 0
created(){
this.annotations = [];
this.annotations.push({
content:'
+ Number(this.valuepct).toLocaleString(undefined,{style: 'percent', minimumFractionDigits:0})
+ '
',
region: 'Series',
coordinateUnits: 'Pixel',
x: '50%', y: '50%'
},{
content:'
+ "font-family:'Segoe UI'" + '>' + this.charname + '
',
region: 'Series',
coordinateUnits: 'Pixel',
x: '85px', y: '50%'
}
);
}
(2) We don't know why location of some e-panels are not showed as we defined, how can we make it show exactly as we defined.
Store Portfolio and Delivery should be on the first column of second row, but it shows in last rows, the templates to Delivery are ejs-accumulationchart, from these left of templates are ejs-chart, this maybe can have some help
<ejs-dashboardlayout id="defaultLayout" ref="dashbordInstance" v-if="isfirstload == false"
:cellSpacing="spacing" :columns="24" allowResizing="true" :key="chartkey"
:resizeStop="onPanelResize" >
<e-panels>
<e-panel :row="0" :col="0" :sizeX="4" :sizeY="1" :content="dtPctChart"></e-panel>
<e-panel :row="0" :col="4" :sizeX="4" :sizeY="1" :content="fcPctChart"></e-panel>
<e-panel :row="0" :col="8" :sizeX="4" :sizeY="1" :content="deliveryPctChart"></e-panel>
<e-panel :row="0" :col="12" :sizeX="4" :sizeY="1" :content="mccafePctChart"></e-panel>
<e-panel :row="0" :col="16" :sizeX="4" :sizeY="1" :content="eotfPctChart"></e-panel>
<e-panel :row="0" :col="20" :sizeX="4" :sizeY="1" :content="partyroomPctChart"></e-panel>
<e-panel :row="1" :col="0" :sizeX="4" :sizeY="3" :content="storeportfolioChart"></e-panel>
<e-panel :row="1" :col="4" :sizeX="4" :sizeY="3" :content="storedeliveryChart"></e-panel>
<--- Above template pf contents are ejs-accumulationchart, bleow template of contents are ejs-chart -->
<e-panel :row="1" :col="8" :sizeX="8" :sizeY="3" :content="avpChart"></e-panel>
<e-panel :row="1" :col="16" :sizeX="8" :sizeY="3" :content="evaChart"></e-panel>
<e-panel :row="2" :col="0" :sizeX="8" :sizeY="3" :content="devcostevaChart"></e-panel>
<e-panel :row="2" :col="8" :sizeX="8" :sizeY="3" :content="soievaChart"></e-panel>
<e-panel :row="2" :col="16" :sizeX="8" :sizeY="3" :content="cashflowChart"></e-panel>
<e-panel :row="3" :col="0" :sizeX="8" :sizeY="3" :content="occupcostevaChart"></e-panel>
<e-panel :row="3" :col="8" :sizeX="8" :sizeY="3" :content="reroievaChart"></e-panel>
<e-panel :row="3" :col="16" :sizeX="8" :sizeY="3" :content="devcycleevaChart"></e-panel>
<e-panel :row="4" :col="0" :sizeX="8" :sizeY="3" :content="agingauvGrid"></e-panel>
Please help us
Thanks
CZ
|
{
content:'+ "font-family:'Segoe UI'" + '>' + this.charname + '',
region: 'Series',
coordinateUnits: 'Pixel',
x: '60%', y: '50%'
} |
HI Indhumathy L,
Thank you for your support.
For Query 1:
x value in percentage is not suitable for this case, because
(1) first annotation 10 is in percent, it is x: '50%', y: '50%', it just show in the center of the circle.
(2) if we change the second annotation DT to x:'60%', below screen shot is the test result.
Since the panel is resizable, 10 and DT can be overlapped when we change the size of the panel, so we want to set up its dynamically value, but we don't know how to get panel size in create() of the vue component's life cycle.
Please help us.
Thanks,
CZ