loki421
03-30-2009, 05:58 PM
Hi again all :)
I've got a tile list and i'm trying to filter the price of products within the list, and 99.99% of these have a .99 on the end, ie £100.99.
So i've created the slider and added the logic for the filter below:
private function filterPrice(item:Object):Boolean
{
if (item.price == productPrice.value)
{
return true;
}
else
{
return false;
}
}
private function doFilterPrice():void
{
if (productPrice.value == 0)
{
productData.filterFunction = null;
}
else
{
productData.filterFunction = filterPrice;
}
productData.refresh();
}
And that works fine if i'm using round numbers, but like i said before, i need to have each value to contain the .99 so that it'll fiter the data correctly. Is this possible? or should i look at another way of doing this?
Or maybe there's some way of preforming a 'like' search instead of an exact match that'd probably work too.
Many thanks in advance all for any help offered :D
I've got a tile list and i'm trying to filter the price of products within the list, and 99.99% of these have a .99 on the end, ie £100.99.
So i've created the slider and added the logic for the filter below:
private function filterPrice(item:Object):Boolean
{
if (item.price == productPrice.value)
{
return true;
}
else
{
return false;
}
}
private function doFilterPrice():void
{
if (productPrice.value == 0)
{
productData.filterFunction = null;
}
else
{
productData.filterFunction = filterPrice;
}
productData.refresh();
}
And that works fine if i'm using round numbers, but like i said before, i need to have each value to contain the .99 so that it'll fiter the data correctly. Is this possible? or should i look at another way of doing this?
Or maybe there's some way of preforming a 'like' search instead of an exact match that'd probably work too.
Many thanks in advance all for any help offered :D