Forums
Script for Bar width and to adjust slider - 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: Script for Bar width and to adjust slider (/showthread.php?tid=375)



Script for Bar width and to adjust slider - rubeena.hajira - 12-22-2022

Script for Bar width and to adjust slider:
*This is to be written on the Connection script area of the respective component.

var len=changedItem.attributes.data.length;
var x=sdk.getWidget('timeline_DR' );
sdk.getWidget( 'timeline_DR').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 =60;
x.m_barwidth =60;
}

else {
x.m_controlbarwidth =65;
x.m_barwidth = 65;
}
}