PDA

View Full Version : Tabslider openPrevious?


Pixelpusher
05-11-2004, 02:38 AM
Hello,
I find the function openPrevious great for the Tabslider. However I was unable to find its counterpart openPrevious. Does this exist? If not please implement it for your next release.

Is there a fast workaround?

Thanks
Pelle

antun
05-11-2004, 01:45 PM
There doesn't appear to be a selectPrevious() method, but remember that the components code is all LZX, so I looked at the source for basetabslider (WEB-INF\lps\components\base\basetabslider.lzx), and saw how the openNext method was written, and copied and adjusted that:


<class name="mytabslider" extends="tabslider">
<method name="openPrevious" > <![CDATA[
var ot = this._selector.getSelection()[0];
var index = -1;
for ( var i = 0; i < this._defaultview.subviews.length; i++ ) {
if ( ot == this._defaultview.subviews[i] ) index = i;
}
index -= 1;
if ( index < 0)
return openTab(this._defaultview.subviews[index]);
else
return false;
]]> </method>
</class>


-Antun