12-23-2022, 10:55 AM
(This post was last modified: 12-23-2022, 10:56 AM by neeraja.pattathil@bdb.ai.)
How to adjust the slider range and bar width of a component by using a script?
Use: to adjust the slider range and bar width.
Script area: connection
Script:
var len=changedItem.attributes.data.length;
var x=sdk.getWidget('timeline56' );
sdk.getWidget( 'timeline56').m_sliderheightratio=4.87; //sliderheight
if(len>15)
{
x.m_showslider=true;
var ab=((15*100)/len);
x.m_sliderrange=ab; //sliderrange
}
else{
x.m_showslider=false;
if(changedItem.attributes.data.length<16)
{
x.m_controlbarwidth =40;
x.m_barwidth =40;
}
else {
x.m_controlbarwidth =45;
x.m_barwidth = 45;
}
}
Use: to adjust the slider range and bar width.
Script area: connection
Script:
var len=changedItem.attributes.data.length;
var x=sdk.getWidget('timeline56' );
sdk.getWidget( 'timeline56').m_sliderheightratio=4.87; //sliderheight
if(len>15)
{
x.m_showslider=true;
var ab=((15*100)/len);
x.m_sliderrange=ab; //sliderrange
}
else{
x.m_showslider=false;
if(changedItem.attributes.data.length<16)
{
x.m_controlbarwidth =40;
x.m_barwidth =40;
}
else {
x.m_controlbarwidth =45;
x.m_barwidth = 45;
}
}