Welcome, Guest. Please login or register.
Did you miss your activation email?
05/21/12, 03:28
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash MX 2004 (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Andresss, papachan)
| | |-+  data set filter problem ?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: data set filter problem ?  (Read 2370 times)
rabid lemming
Server what's that
*
Posts: 3


Flash Student

lemming29@hotmail.com
View Profile WWW Email
« on: 03/16/05, 20:16 »

Hi all,

I have this code:

Code:
stop();
/* ------------------------------------------------------ */
/* Set Style                                              */
/* ------------------------------------------------------ */
SearchBox.setStyle( "borderStyle", "inset" );
ListBox.setStyle( "borderStyle", "solid" );
InfoBox.setStyle( "borderStyle", "solid" );
ListBox.setStyle( "rollOverColor", 0xdae4f0 );
ListBox.setStyle( "selectionColor", 0x88aed3 );
ListBox.setStyle( "textRollOverColor", 0x000000 );
ListBox.setStyle( "textSelectedColor", 0xffffff );
ListBox.setStyle( "selectionDuration", 0 );
/* ------------------------------------------------------ */
/* ListBox Functions                                      */
/* ------------------------------------------------------ */
ListBox.iconFunction = function( item ) {
var covType:String = item.data.coverage.attributes.type;

if( covType == "full" ) {
return "iconCovered";
} else if( covType == "partial" ) {
return "iconPartial";
} else {
return "iconNotCovered";
}
}
function fillBox() {
ListBox.removeAll();
xmlDataSet.refreshDestinations();
ListBox.sortItemsBy( "label", "ASC" );
ListBox.selectedIndex = 0;
}
/* ------------------------------------------------------ */
/* Navigation Functions                                   */
/* ------------------------------------------------------ */
function gotoListItem( ind:Number ):Void {
ListBox.selectedIndex = ind;
ListBox.vPosition = ind;
InfoBox.refreshFromSources();
}
function gotoListAlpha( letter:String ):Void {
letter = letter.substr( 0, 1 ).toUpperCase();

ListBox.selectedIndex = 0;

while( ListBox.selectedItem.label.substr( 0, 1 ).toUpperCase()
< letter && ListBox.selectedIndex < ListBox.length - 1 ) {
ListBox.selectedIndex += 1;
}
gotoListItem( ListBox.selectedIndex );
}

function selectCoverage( option:String ):Void {
//xmlDataSet.filtered = false;
if( dataFilter == option ) {
dataFilter = "";
} else {
//xmlDataSet.filtered = true;
xmlDataSet.filterFunc = function( item:Object ):Boolean {
//trace( item.coverage.attributes.type == option );
return( item.coverage.attributes.type == option );
}
dataFilter = option;
}
xmlDataSet.filtered = false;
xmlDataSet.filtered = true;
//xmlDataSet.refreshDestinations();
ListBox.updateControl();
//fillBox();
}
/* ------------------------------------------------------ */
/* Event Handlers                                         */
/* ------------------------------------------------------ */
var res = function( ev ) {
xmlDataSet.addSort( "alpha", ["name"], DataSetIterator.Ascending | DatasetIterator.CaseInsensitive );
fillBox();
}

/* ------------------------------------------------------ */
/* Commands On Load                                       */
/* ------------------------------------------------------ */
var dataFilter:String;
xmlConnect.addEventListener( "result", res );
this.xmlConnect.trigger();

button code:

Code:
on( release ) {
selectCoverage( "full" );
}

And I am trying to use a sort function but its not working. Upon further investigation, it may be that the dataset is filtering properly, but the list isn't pulling in the new results. It seems to be pulling in all the dataset records, rather than just the filtered ones.

Any help is appreciated

Cheers
Rabid Lemming
Logged


I will wait for death with a smile and a big stick
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 03/17/05, 04:17 »

Do you have bindings between the ListBox and the dataset? What's this ListBox.updateControl function?

Jorge
Logged

arlyn9391
Server what's that
*
Posts: 1


View Profile Email
« Reply #2 on: 05/22/09, 03:43 »

Hi all,

I have this code:

Code:
stop();
/* ------------------------------------------------------ */
/* Set Style                                              */
/* ------------------------------------------------------ */
SearchBox.setStyle( "borderStyle", "inset" );
ListBox.setStyle( "borderStyle", "solid" );
InfoBox.setStyle( "borderStyle", "solid" );
ListBox.setStyle( "rollOverColor", 0xdae4f0 );
ListBox.setStyle( "selectionColor", 0x88aed3 );
ListBox.setStyle( "textRollOverColor", 0x000000 );
ListBox.setStyle( "textSelectedColor", 0xffffff );
ListBox.setStyle( "selectionDuration", 0 );
/* ------------------------------------------------------ */
/* ListBox Functions                                      */
/* ------------------------------------------------------ */
ListBox.iconFunction = function( item ) {
var covType:String = item.data.coverage.attributes.type;

if( covType == "full" ) {
return "iconCovered";
} else if( covType == "partial" ) {
return "iconPartial";
} else {
return "iconNotCovered";
}
}
function fillBox() {
ListBox.removeAll();
xmlDataSet.refreshDestinations();
ListBox.sortItemsBy( "label", "ASC" );
ListBox.selectedIndex = 0;
}
/* ------------------------------------------------------ */
/* Navigation Functions                                   */
/* ------------------------------------------------------ */
function gotoListItem( ind:Number ):Void {
ListBox.selectedIndex = ind;
ListBox.vPosition = ind;
InfoBox.refreshFromSources();
}
function gotoListAlpha( letter:String ):Void {
letter = letter.substr( 0, 1 ).toUpperCase();

ListBox.selectedIndex = 0;

while( ListBox.selectedItem.label.substr( 0, 1 ).toUpperCase()
< letter && ListBox.selectedIndex < ListBox.length - 1 ) {
ListBox.selectedIndex += 1;
}
gotoListItem( ListBox.selectedIndex );
}

function selectCoverage( option:String ):Void {
//xmlDataSet.filtered = false;
if( dataFilter == option ) {
dataFilter = "";
} else {
//xmlDataSet.filtered = true;
xmlDataSet.filterFunc = function( item:Object ):Boolean {
//trace( item.coverage.attributes.type == option );
return( item.coverage.attributes.type == option );
}
dataFilter = option;
}
xmlDataSet.filtered = false;
xmlDataSet.filtered = true;
//xmlDataSet.refreshDestinations();
ListBox.updateControl();
//fillBox();
}
/* ------------------------------------------------------ */
/* Event Handlers                                         */
/* ------------------------------------------------------ */
var res = function( ev ) {
xmlDataSet.addSort( "alpha", ["name"], DataSetIterator.Ascending | DatasetIterator.CaseInsensitive );
fillBox();
}

/* ------------------------------------------------------ */
/* Commands On Load                                       */
/* ------------------------------------------------------ */
var dataFilter:String;
xmlConnect.addEventListener( "result", res );
this.xmlConnect.trigger();

button code:

Code:
on( release ) {
selectCoverage( "full" );
}

And I am trying to use a sort function but its not working. Upon further investigation, it may be that the dataset is filtering properly, but the list isn't pulling in the new results. It seems to be pulling in all the dataset records, rather than just the filtered ones.

Any help is appreciated

Cheers
Rabid Lemming


If you having a problem with your data set filter, that is really a big problem.



_________________
Aprilaire
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything