Forums
Adjust slider range and bar width using script - Printable Version

+- Forums (https://bdn.bdb.ai)
+-- Forum: BDB Knowledge Base (https://bdn.bdb.ai/forumdisplay.php?fid=13)
+--- Forum: BDB Dashboards Designer (https://bdn.bdb.ai/forumdisplay.php?fid=43)
+---- Forum: BDB Designer Q & A (https://bdn.bdb.ai/forumdisplay.php?fid=16)
+---- Thread: Adjust slider range and bar width using script (/showthread.php?tid=504)



Adjust slider range and bar width using script - neeraja.pattathil@bdb.ai - 12-23-2022

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;
}
}