Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7689153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:05:53+00:00 2026-05-31T20:05:53+00:00

I’ve search all over today trying to find how to do this, and not

  • 0

I’ve search all over today trying to find how to do this, and not being familiar with actionscript is starting to catch up to me. What I would like to accomplish is: I have a list of messages in a Datagrid coming from a dataprovider in another class, which in turn gets them from our Oracle DB. I need to all the user to set a visible state on the message, and then filter that out of the datagrid with the click of a button. I have the check box for hide, and it sets that value into the database. I can’t figure out how to get the filterFunction to work with an array collection when the filter parameter is within the row data.

Here is the code

public function filterResults():void {

            modelLocator.notification.messageList.filterFunction = filterRows;

            modelLocator.notification.messageList.refresh(); 


        }

        public function filterRows(item:Object):Boolean {
            //return true if row should stay visible
            //return false if it should go away

             var i:int;

            if(showAll == false) {//checks whether this is coming from the hide or show all button
            //Somehow need to interrogate the row data to check if messageVisible is set to true or false

             /* if (showAll == false) {
                return false;
            }else {
                return true;
            }
            return false; */ 

        }
        public var showAll:Boolean;

        public function showAllMessages():void{

            showAll = true;
            filterResults();
        }
        public function hideMessages():void{
            showAll = false;
            filterResults();
        }


    ]]>
</mx:Script>

<mx:VBox>
    <component:EditMessage id="editMessage"  width="930" height="445"/>
    <mx:Panel id="messageListPanel" title="Message History" layout="vertical" width="930" height="196" horizontalAlign="left">

        <mx:DataGrid id="messageDataGrid" dataProvider="{modelLocator.notification.messageList}" 
                     width="910" height="139" enabled="true" mouseEnabled="true" editable="false"
                     rowCount="5" itemClick="{selectMessage()}">

            <mx:columns>
                <mx:DataGridColumn headerText="Date Created" labelFunction="formatCreateDate" width="60"/>
                <mx:DataGridColumn headerText="From" dataField="senderEmail" width="100"/>
                <mx:DataGridColumn headerText="Subject" dataField="subject" width="100"/>
                <mx:DataGridColumn headerText="Start Date" labelFunction="formatStartDate" width="60"/>
                <mx:DataGridColumn headerText="End Date" labelFunction="formatEndDate" width="60" />
                <mx:DataGridColumn headerText="Date Sent" labelFunction="formatSendDate" width="60" />
                <mx:DataGridColumn headerText="Sender Netid" dataField="senderNetId" width="50" />
                <mx:DataGridColumn headerText="Sender Name" dataField="senderName" width="80" />
                <mx:DataGridColumn headerText="Message" dataField="message" width="100" />
                <mx:DataGridColumn headerText="Message Id" dataField="id" width="10" />
            </mx:columns>
        </mx:DataGrid>              
    </mx:Panel>                 
</mx:VBox>
<mx:Button id="showMessagesBtn" x="786" y="452" label="Show All Messages" click="showAllMessages()"/>
<mx:Button id="hideMessagesBtn" x="665" y="452" label="Hide Messages" click="hideMessages()" />

I found a tutorial on doing this with incoming text here http://franto.com/filter-results-in-datagrid-flex-tutorial/, but cannot figure out the above mentioned problem, this really can’t be that difficult, can it?

Thanks,

Ian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:05:54+00:00Added an answer on May 31, 2026 at 8:05 pm

    item is an element of the dataprovider the method is called for each element in the dataprovider and flags the item for inclusion in length and iteration.

           public function filterResults():void {
    
                modelLocator.notification.messageList.filterFunction = filterRows;
    
                modelLocator.notification.messageList.refresh(); 
    
    
            }
    
            public function filterRows(item:Object):Boolean {
                if(showAll)
                    return true;
                if(item.messageVisible=="true")
                    return true;
                return false;
            }
            public var showAll:Boolean;
    
            public function showAllMessages():void{
    
                showAll = true;
                filterResults();
            }
            public function hideMessages():void{
                showAll = false;
                filterResults();
            }
    
    
        ]]>
    </mx:Script>
    
    <mx:VBox>
        <component:EditMessage id="editMessage"  width="930" height="445"/>
        <mx:Panel id="messageListPanel" title="Message History" layout="vertical" width="930" height="196" horizontalAlign="left">
    
            <mx:DataGrid id="messageDataGrid" dataProvider="{modelLocator.notification.messageList}" 
                         width="910" height="139" enabled="true" mouseEnabled="true" editable="false"
                         rowCount="5" itemClick="{selectMessage()}">
    
                <mx:columns>
                    <mx:DataGridColumn headerText="Date Created" labelFunction="formatCreateDate" width="60"/>
                    <mx:DataGridColumn headerText="From" dataField="senderEmail" width="100"/>
                    <mx:DataGridColumn headerText="Subject" dataField="subject" width="100"/>
                    <mx:DataGridColumn headerText="Start Date" labelFunction="formatStartDate" width="60"/>
                    <mx:DataGridColumn headerText="End Date" labelFunction="formatEndDate" width="60" />
                    <mx:DataGridColumn headerText="Date Sent" labelFunction="formatSendDate" width="60" />
                    <mx:DataGridColumn headerText="Sender Netid" dataField="senderNetId" width="50" />
                    <mx:DataGridColumn headerText="Sender Name" dataField="senderName" width="80" />
                    <mx:DataGridColumn headerText="Message" dataField="message" width="100" />
                    <mx:DataGridColumn headerText="Message Id" dataField="id" width="10" />
                </mx:columns>
            </mx:DataGrid>              
        </mx:Panel>                 
    </mx:VBox>
    <mx:Button id="showMessagesBtn" x="786" y="452" label="Show All Messages" click="showAllMessages()"/>
    <mx:Button id="hideMessagesBtn" x="665" y="452" label="Hide Messages" click="hideMessages()" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.