[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-14 Thread stinasius
hi Tim, thanks your solution worked well. for anyone who is interested in filtering a datagrid with multiple criteria here is how i pieced up mine through the enormous help from this group. filters//

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-14 Thread Tim Hoff
Good deal. A lot of refreshing going on there though. :-) -TH --- In flexcoders@yahoogroups.com, stinasius [EMAIL PROTECTED] wrote: hi Tim, thanks your solution worked well. for anyone who is interested in filtering a datagrid with multiple criteria here is how i pieced up mine through the

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-11 Thread Tim Hoff
Ok, enough f%#king around, please try to isolate the slider filter function and behavior first. Below is the basic structure of what you need to do with the slider. Please give it a try and when you get this working, move on to combining it with the comboBoxes. -TH private var sliderFromValue

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-11 Thread Tim Hoff
Ok, enough messing around, please try to isolate the slider filter function and behavior first; before trying to add it to the comboBox filtes. Below is a basic sturcture of what you need to do. Please give it a try and when you get this working, move on to combining it with the comboBoxes.

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-10 Thread Tim Hoff
Still think that you need to take out values=[0,300]. This will lock the sliders to either of those values; with nothing in between. -TH --- In flexcoders@yahoogroups.com, stinasius [EMAIL PROTECTED] wrote: hi guy i appreciate that you are really trying to help. but so far i still have

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-10 Thread stinasius
when i take out values=[0,300] there is no change in the behavior. is the way i call the filter function on the change events of the combos and slider correct? have a feeling that's what is causing the problem.

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-09 Thread stinasius
hi guy i appreciate that you are really trying to help. but so far i still have the same problem, when i remove the slider from the filter equation the datagrid is filtered but when i add it something wired happens(the data disappears from the grid) here is a sample of my code and i call the

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-08 Thread stinasius
hi guys i hope am not being a pain, but how can i use a combo box and a slider (two thumbed) to fliter a datagrid? a small code sample will do it. thanks.

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-08 Thread Tim Hoff
No worries, It looks like your filter function already uses the comboBox's selectedLabel to compare. You can initiate the filter like this: private function filterDataGrid():void { myArrayCollection.filterFunction = myFilterFunction; myArrayCollection.refresh(); } mx:ComboBox

RE: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-08 Thread Gordon Smith
I don't have a tested code sample to offer, but you would use the fact that your DataGrid's dataProvider has probably been turned into an ArrayCollection, which has a filterFunction property. You set the filterFunction to be a reference to a method that takes a single data item as an argument and

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
Waiting on a server-side bugfix, so enjoy. Working example: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread stinasius
hi josh nice example but how about using one slider with two thumbs?

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
Don't know, I imagine the first step will be building or locating a dual-thumb slider :) On Wed, Aug 6, 2008 at 4:42 PM, stinasius [EMAIL PROTECTED] wrote: hi josh nice example but how about using one slider with two thumbs? -- Flexcoders Mailing List

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread stinasius
i managed to build a dual thumb slider that i pass on the filter function. here is the code. mx:HSlider x=0 y=240 id=priceSlider minimum=0 maximum=300 tickInterval=10 snapInterval=10 thumbCount=2 values=[0,300] tickColor=#ff labels=[$0k,$300M] liveDragging=true width=182

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
Shows how often I use the sliders. I didn't know you could use multiple thumbs... This is not performant, you should be getting the max and min within updateFilter() and sticking them in private vars, not in the filter function itself... but you get the idea. private function

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Tim Hoff
Yeah shoot, my bad. Take the values property out of the tag. Should have said set the min to 0 and the max to 3,000,000 (like you have it. The values will lock the thumbs to those two positions (values) only. -TH --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Tim Hoff
And go back to your original filterFunction: if ( (city_cb.selectedLabel == All || item.city == city_cb.selectedLabel) (lct_cb.selectedLabel == All || item.location == lct_cb.selectedLabel) (item.value priceSlider.values[0] item.value priceSlider.values[1]) ){ result=true; } return result;

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
Complete example with 2 thumbs (from the earlier example): ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Tim Hoff
Hey Josh, What's up with: return item.value = Math.min(priceSlider.values[0],priceSlider.values[1]) item.value =Math.max(priceSlider.values[0],priceSlider.values[1]); You can avoid this by setting allowThumbOverlap=false. Then just use: return item.value = priceSlider.values[0] item.value

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
Coz it's a quick and nasty (but working) example, and I have zero knowledge about the finer details of the slider controls :) On Thu, Aug 7, 2008 at 9:28 AM, Tim Hoff [EMAIL PROTECTED] wrote: Hey Josh, What's up with: return item.value =

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
FWIW, If I were building this for users, I'd still allow sliders to overlap for ease-of-use purposes, but I'd fetch max and min on change rather than every loop of the filter function ;-) -Josh On Thu, Aug 7, 2008 at 9:31 AM, Josh McDonald [EMAIL PROTECTED] wrote: Coz it's a quick and nasty

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Tim Hoff
No worries. Actually, allowThumbOverlap=false is the default. For me, allowing thumb overlap would purly depend on the use case. My opinin is that it makes more sense to the user to not allow the right thumb to go past the left thumb and vice versa. but, IMHO. Good example. -TH --- In

Re: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-06 Thread Josh McDonald
It's probably just a personal preference. You're thinking max and min thumbs, I'm thinking between foo and bar :) I was just thinking about the use case where the user has min = 1000, max = 2000 and wants to set min=0, max=800 - without thumb overlapping, you've gotta move the min thumb first,

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread stinasius
hi thanks for the link, maybe you can help me out here, i am filtering the datagrid using three controls (2 combo boxes and a slider), the filter works without the slider but when i add the slider into the equation nothing shows up in the data grid when each control is clicked. here is my filter

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread Tim Hoff
Hi, Your code for the filter function looks fine. Must be a data or slider value issue. Make sure that you set the slider's values array to two values that would include all of the prices in the dataProvider. It's possible that the range of values for the slider is too low or high; thus

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread stinasius
hi my price ranges are between 0 and 3,000,000 so should my max value be 3,000,000 or 1? thanks

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread Tim Hoff
mx:HSlider values=[0,30]/ --- In flexcoders@yahoogroups.com, stinasius [EMAIL PROTECTED] wrote: hi my price ranges are between 0 and 3,000,000 so should my max value be 3,000,000 or 1? thanks

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread stinasius
hi i tried just that but nothing shows up in my datagrid when i filter it. what could be the problem? here is my update filter function public function filterGrid():void{ dataAr.filterFunction=cityFilter; dataAr.refresh();

RE: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread Alex Harui
Make sure your filter function returns true for some of the data From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of stinasius Sent: Tuesday, August 05, 2008 10:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: filtering a flex

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread stinasius
hi my filter function returns true for some of the data and in fact when i remove the slider filter statement, everything works well. another thing is that i set the onChange function of the combo boxes and the slider to filterGrid(). is that ok or am doing it the wrong way?

RE: [flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread Alex Harui
removing the filterfunction doesn't really prove anything. Whenever you call refresh() after you've assigned the filterFunction, your filterfunction should get called. If you add a trace statement, you should see it once per item in the dataprovider. From:

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-05 Thread stinasius
hi if you dont mind could you clarify on the trace statement, am not sure i understand what you said or how to go about it. thanks

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-04 Thread Michael VanDaniker
You'll want to listen for the change event on the slider. In the event handler you can do something like this... collection.filterFunction = filterByPriceRange; collection.refresh(); Then you'll want your filterByPriceRange function to return true if the price of the given object is between the

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-04 Thread stinasius
hi am fairly new to flex. if you dont mind maybe you could post some small example on how to do it. thanks

[flexcoders] Re: filtering a flex datagrid using a slider with two thumbs

2008-08-04 Thread Michael VanDaniker
flexexamples is a great site for fully functioning code snippets. In the example here http://blog.flexexamples.com/2008/03/12/using-a-combobox-to-filter-items-in-a-datagrid-in-flex/ you'll want to swap out the CheckBox for a HSlider, obviously. Then you can call toggleFilter() when the slider