Displaying different data in datagrid cells using a cellrenderer?

Gidday guys
I'm populating a datagrid using SQLite. Some SQL columns contain 1 or 0 as booleans, and I want to display this as a bullet point in my datagrid.
Currently I have a conditional that checks for a 1, and if found, displays the bullet point. I figure there must be a better way, but am unsure how to do this with cellrenderers. I get how to add components using cellrenderers, but is there a way to replace the cell display with another character (without actually changing the data of the dataprovider) ?
Cheers for taking a look.

It would be better performance to draw a simple shape rather than a TextField with a single character in it. To do so, yes you'd need to override the cell renderer. I often choose the latter but usually use GPU-driven components like FeathersUI components.
If you have an excessively large amount of data and/or are on a device and want to do this because you're getting poor performance, that's a good usage of your time. Also if you just want to learn how to do it just to do it, that's can also be a good usage, if you complete your work on time. However if it's for desktop and/or the data is pretty minimal (few dozen rows up to a hundred or so, with a nominal amount of columns), it's probably not worth your time.
I'm sure you have this link but:
http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d1 18a9c65b32-7fd4.html
All component cellrenderers tend to be the same (because larger components use smaller components and the architecture lines up). The difference is in making sure your renderer supports the data it's provided. If you need only a TextField and/or a bullet, that's pretty easy. Most components (like lists) support icons and you'll need to make sure you provide the complete implementation of all data scenarios in your cellrenderer.
Pay attention to cell dequeue techniques on some components. If all cells commonly have only text, cells aren't destroyed and recreated as the list scrolls. The data is resent to the cell and the cell has a chance to simply update itself rather than recreate itself from scratch. This offers a big performance increase not having to destroy and recreate needlessly. It can also really confuse people when cells start appearing empty as you scroll (because the cell construction methods aren't run). 

Similar Messages

  • Displaying different data series on drilldown

    I have a bar/line combo chart which displays two data series in bar form and one in line form.
    What I want to be able to do is to only show the bars when drilling down and not the line data series.
    I haven't found a way to do this yet, can anyone help?

    Thanks for the reply.
    I had considered using navigation to go to another chart, but surely if I do this it will go to the same chart wherever I click on the chart, rather than actually drilling down to the next level in the dimension (and thus being different depending on which item I click on) as a normal drilldown should do, unless I have missed something in your explanation?

  • Displaying RichTextEditor Data in datagrid

    Hi,
    I have a form in which I am using RichTextEditor to collect
    data. In other page I am displaying the same data in the datagrid.
    How do I display the data in the datagrid as htmlText. Do I use the
    label function? If yes then how.
    Thanks

    Hello,
    does anyone have an answer to the question asked in the thread above????
    here is my code -
    <mx:DataGrid width="846" height="292" id="site_contact_eventDG" dataProvider="{siteContactEventData}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="SN" dataField="site_contact_event_id" width="40"/>
                            <mx:DataGridColumn headerText="Date of Event" dataField="date" width="200"/>
                            <mx:DataGridColumn headerText="Note" dataField="notes" wordWrap="true" width="200"/>
                        </mx:columns>
                    </mx:DataGrid>
    The dataprovider is coming from a MySQL database with the dataField "notes" currently Rich Text.  It is populating the datagrid but the Rich Text is being displayed.
    here is an example of the XML being returned.
    <site_contact_event_id><![CDATA[2]]></site_contact_event_id>
          <site_id><![CDATA[1]]></site_id>
          <date><![CDATA[2009-05-14]]></date>
          <notes><![CDATA[<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">s</FONT></P></TEXTFORMAT>]]></notes>
    Attached is a sceen shot of the current datagrid.
    Any help would be appreciated.
    Thanks
    Scott

  • How to display different headings in list form using "hide content" in SPD 2010

    I built a custom list form in SPD, and applied conditional formatting in some rows
    Now I like to display different headings (above the 1st row of the form), based on the same condition:
    e.g. when Status=available, display the heading "SIGN OUT"  (as the item is available for sign-out)
    when Status=on-loan, display the heading "SIGN IN" (as the item can be signed in)
    right now I put the two different heading in two lines in the heading space: 
    SIGN OUT
    SIGN IN
    I tried following and it works for this part:
    select the text SIGN IN
    select "create' in "Conditional formatting" pane
    select Hide Content
    Set: Status=available
    click OK
    Then the "SIGN IN" text disappeard.
    But how can I set another conditional formatting to show only "SIGN IN" when Status=on loan?

    Hi,
    If you like to show "sign out" when status=available and show "sign in" when status=on-loan.
    Please try modify the Conditional Formating rule as below:
    Select the text SIGN IN, show content, status not equals available
    Select the text SIGN OUT, show content, status not equals on-loan
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • How to display system date on table cells

    hi all,
    I would like to display the PC date onto a specified cell on a table. I have attached here my vis. I don't know how to get the date displayed at the table cell On the front panel when I run it. Please help.
    Attachments:
    data.vi ‏32 KB
    getPCdate.vi ‏9 KB

    Hi,
    The table control is simply a 2D array of string. So all you need to do is to pick up the Date from the appropriate .vi and replace the array element (using replace array subset) and write the whole table back again. (Example attached for LV 6.0.x)
    // it takes almost no time to rate an answer
    Attachments:
    Untitled_1.vi ‏13 KB

  • ICal chooses a different date when "Mon" is used instead of "Monday"...

    I just made an appointment for an eye exam at Pearle Vision. They've sent me and email in which it had the day, date and time. I selected it, on my iPhone 5 running iOS 7. It set the event on a totally wrong date, a few months difference.
    This is how the email has it typed out.
    Mon 04-07-2014 02:00 PM
    iCal set the even for July 4th, which here in the US, every eye doctor isn't working for the most part.
    I sent a few test emails with different ways of typing it out. It would appear if "Mon" was used, then it would think that the second set of numbers is the month.
    Type out Monday 04-07-2014 02:00 PM and it will set an event for April 7, 2014 at 2PM. Type out Mon 04-07-2014 02:00 PM and it'll set an event for July 4th 2014 at 2PM.
    I also tried this on my 2012 Mac Mini with 10.9.2, same results happen.
    Any thoughts?
    KOT

    Thanks. That makes sense.
    So to understand this correctly:
    To be sure to get the result I want, that is a Session Bean that keeps track of animals added to my list, I will have to used the same instance of a STATEFUL Session Bean.
    The reason why it works here with a STATELESS Session Bean is because of the pooling but I CANNOT rely on this feature as with more requests.
    Am I understund this correctly?
    Claus

  • Numbers '09: How can I display selected data from one cell in another cell?

    Hello.
    I have a Numbers document that contains a table that looks a little like this:
    Amount;Code
    Amount
    Code
    10;12B
    12;8A
    14;16E
    16;3C
    18;5A
    I'd like to have Numbers 09 automatically separate the "Amount;Code" data in the coloumns to the right.
    Do you know the right function and/or equation to make this happen? Any help would be greatfully appreciated.
    Cameron168

    Formula for Amount:
    =LEFT(A2,FIND(";",A2,1)-1)
    Formula for Code
    =RIGHT(A2,LEN(A2)-FIND(";",A2,1))
    I just modified the equation for separting first and last names from:
    http://www.bluemoosetech.com/microsoft-excel-functions.php?jid=32
    You will have to put in your correct cell names
    Tested it and it works!
    Have fun!

  • Firefox is displaying improper dates and times while using Google calendar, however they display correctly in Internet Explorer. Firefox has always worked right before, but not now.

    The Google calendar's information is accurately saved on our end on this sample page.

    Works for me on Linux.
    You can try http://kb.mozillazine.org/Time_and_time_zone_settings

  • How to display table data without  using ALV  and table element.

    Hi,
            Its possible to display table data without using ALV  and table element.
           Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
           (every time i am fetching single row data ),
           But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
           settings and header data etc..things.
          Give solution to  display data part..
    Regards,
    Rakhi.

    Hi,
    Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
    In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
      DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
        LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
    * Standard Filter Function setting to FALSE
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
        LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
    * Standard Filter Function setting to FALSE Ends
    Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
    Hope this answers your query.
    Thanks.
    Kumar Saurav.

  • Adding MovieClip to DataGrid Cell

    Hi to all..
    I have added components like ComboBox, CheckBox etc in the
    DataGrid cell..
    But Now I want to add MovieClip If not possible then Swf in
    the DataGrid cell using cellrenderer.
    Is it possible to add such things.
    If yes can you guide me how..? I have spend 3 days after
    this... Please Help me out..
    Thanks.

    quote:
    Hi...
    I'm using AS3.
    By the way I have added Movieclip on the data grid cell...
    But now the problem is how to make it editable because I have
    added two components on the same cell...
    And that cell take this both component as object and you can
    not edit that object by just making that column as editable =
    true... so if any one can suggest me the way..
    the help will be appreciated......

  • Jstl tags to display System date.

    Hi there,
    Please let me know how to how to display system date on jsp page using jstl.
    I dont know much about jstl, and i was till now using java code in jsp instead of jstl.
    Since using java in jsp is considered a bad programing these days, I dont want to use java
    to display the date.
    Can anyone help me switch to jstl tags.
    Please help me with the date issue.

    [This will help you|http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html] learn what JSTL tags are available. Once you get that it should be relatively easy to figure out what you nee. If you have questions on a particular tag then a [Google search almost always|http://www.google.com/search?q=jstl+fmt%3AformatDate] brings up example usage.

  • Draw gradient datagrid cells

    Hi
    How can I draw a gradient backround in a datagrid cell using
    a class that expends a DataGridItemRenderer Class ?
    Thanks,
    Aubry

    "bujj_xyz" <[email protected]> wrote in
    message
    news:g9qqms$goo$[email protected]..
    > hi,
    >
    > you told advanced datagrid but i can use only datagrid,
    for advanced
    > datagrid
    > there is background message...thats why
    >
    > if u don't mine can u give me any example i need very
    urgent.
    You can get rid of the message by upgrading to pro.

  • DataGrid to display No Data when dataProvider is null

    Hi,
    Im new to flex. im trying to display "No Data" when the
    dataProvider for the DataGrid is null.
    how can i do this. can i display the text "No Data" in the
    grid or can i display text "No Data" with out grid
    Thanks in advance

    Are you saying that if the data provider is null then while
    you want to be able to create a DataGrid with a single row of data,
    where the cells in that one row for all columns contain "No Data"?
    In that case perhaps you can use the creationComplete event,
    and if the dataProvider is null dynamically create an Object with
    number of fields for the columns, all with the data "No Data". Of
    course, if your data is coming in from HTTPService etc., you might
    display this for a split second before true data gets populated.
    If you want to ensure that "No Data" is displayed for an
    individual cell if no data is available, the maybe a labelFunction
    would do the trick.

  • DataGrid does not display XML data

    Hello, and thanks for reading this...
    I am having a problem displaying XMLList data in a DataGrid.
    The data is coming from a Tree control, which is receiving it
    from a database using HTTPService.
    The data is a list of "Job Orders" from a MySQL database,
    being formatted as XML by a PHP page.
    If it would be helpful to see the actual XML, a sample is
    here:
    http://www.anaheimwib.com/_login/get_all_orders_test2.php
    All is going well until I get to the DataGrid, which doesn't
    display the data, although I know it is there as I can see it in
    debug mode. I've checked the dataField property of the appropriate
    DataGrid column, and it appears correct.
    Following is a summary of the relevant code.
    ...An HTTPService named "get_all_job_orders" retrieves
    records from a MySQL database via PHP...
    ...Results are formatted as E4X:
    HTTPService resultFormat="e4x"
    ...An XMLListCollection's source property is set to the
    returned E4X XML results:
    ...The "order" node is what is being used as the top-level of
    the XML data.
    <mx:XMLListCollection id="jobOrdersReviewXMLList"
    source="{get_all_job_orders.lastResult.order}"/>
    ...The "jobOrdersReviewXMLList" collection is assigned to be
    the dataProvider property of a Tree list, using the @name syntax to
    display the nodes correctly, and a change event function is defined
    to add the records to a DataGrid on a separate Component for
    viewing the XML records:
    <mx:Tree dataProvider="{jobOrdersReviewXMLList}"
    labelField="@name"
    change="jobPosForm.addTreePositionsToDG(event)"/>
    ...Here is the relevant "jobPosForm" code (the Job Positions
    Form, a separate Component based on a Form) :
    ...A variable is declared:
    [Bindable]
    public var positionsArray:XMLList;
    ...The variable is initialized on CreationComplete event of
    the Form:
    positionsArray = new XMLList;
    ...The Tree's change event function is defined within the
    "jobPosForm" Component.
    ...Clicking on a Tree node fires the Change event.
    ...This passes an event object to the function.
    ...This event object contains the XML from the selected Tree
    node.
    ...The Tree node's XML data is passed into the positionsArray
    XMLList.
    ...This array is the dataProvider for the DataGrid, as you
    will see in the following block.
    public function addTreePositionsToDG(event:Event):void{
    this.positionsArray = selectedNode.positions.position;
    ...A datagrid has its dataProvider is bound to
    positionsArray.
    ...(I will only show one column defined here for brevity.)
    ...This column has its dataField property set to "POS_TITLE",
    a field in the returned XML record:
    <mx:DataGrid width="100%" variableRowHeight="true"
    height="75%" id="dgPositions"
    dataProvider="{positionsArray}" editable="false">
    <mx:columns>
    <mx:DataGridColumn width="25" headerText="Position Title"
    dataField="POS_TITLE"/>
    </mx:columns>
    </mx:DataGrid>
    In debug mode, I can examine the datagrid's dataProvider
    property, and see that the correct XML data from the Tree control
    is present. However, The datagrid does not display the data in any
    of its 6 columns.
    Does anyone have any advice?
    Thanks for your time.

    Hello again,
    I came up with a method of populating the DataGrid from the
    selected Item of a Tree Control which displays complex XML data and
    XML attributes. After the user clicks on a Tree branch, I call this
    function:
    public function addTreePositionsToDG(event:Event):void{
    //Retrieve all "position" nodes from tree.
    //Loop thru each Position.
    //Add Position data to the positionsArray Array Collection.
    //The DataGrid dataprovider is bound to this array, and will
    be updated.
    positionsArray = new ArrayCollection();
    var selectedNode:Object=event.target.selectedItem;//Contains
    entire branch.
    for each (var position:XML in
    selectedNode.positions.position){
    var posArray:Array = new Array();
    posArray.PK_POSITIONID = position.@PK_POSITIONID;
    posArray.FK_ORDERID = position.@FK_ORDERID;
    posArray.POS_TITLE = position.@POS_TITLE;
    posArray.NUM_YOUTH = position.@NUM_YOUTH;
    posArray.AGE_1617 = position.@AGE_1617;
    posArray.AGE_1821 = position.@AGE_1821;
    posArray.HOURS_WK = position.@HOURS_WK;
    posArray.WAGE_RANGE_FROM = position.@WAGE_RANGE_FROM;
    posArray.WAGE_RANGE_TO = position.@WAGE_RANGE_TO;
    posArray.JOB_DESCR = position.@JOB_DESCR;
    posArray.DES_SKILLS = position.@DES_SKILLS;
    positionsArray.addItem(posArray);
    So, I just had to manually go through the selected Tree node,
    copy each XML attribute into a simple Array, then ADD this Array to
    an ArrayCollection being used as the DataProvider for the DataGrid.
    It's not elegant, but it works and I don't have to use a Label
    Function, which was getting way too complicated. I still think that
    Flex should have an easier way of doing this. There probably is an
    easier way, but the Flex documentation doesn't provide an easy path
    to it.
    I want to thank you, Tracy, for the all the help. I checked
    out the examples you have at www.cflex.net and they are very
    helpful. I bookmarked the site and will be using it as a resource
    from now on.

  • Not able to display data in separate columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
    This is an urgent need. Please help me out.

    Hi,
    I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
    eg:
    select
    case
    TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2)
    = :P15_EV_LCL
    then
    span style="background-color:lightgreen"
    || TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    else
    span style="background-color:yellow"
    || TRUNC(
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    end "Effort"
    from actuals Z
    If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
    Please suggest
    Thanks
    Sudhir
    Edited by: Sudhir_N on Mar 23, 2009 10:00 PM

Maybe you are looking for

  • Will it make any sense to create materialized view on top of a MOLAP cube?

    Hi, We have developed few MOLAP cubes for our reporting environment. Now we are planning to create materialized with query rewrite enabled for faster performance? Is this a correct approach? Will it make any sense? I mean will i get any performance i

  • How to install applications in download section on iPod touch

    Q:1) I am using windows XP and i have seen applications given in doownload section of this website. for iPod touch and iPhone. Is there a way i can install these applications on my iPod touch using windows XP? Q:2) I want to cutomize my home screen w

  • How do I change font in Ical 4.04

    How do I change font/size in Ical 4.04 montly event edit?

  • A stumper..any ideas

    Crashed while installing software. Now I cant load many 3rd party software: Office,Quicken,Acrobat,photoshop CS. Ive reset permissions,NVRAM... removed battery,reinstalled... wiped the hard drive twice/reinstalled from time machine and OS disk No luc

  • Run a Batch Process

    Hi all, I created a process chain in rspc. It is a batch process. I want to run it from bpc for excel on data manager. I created a package and i choosed my process chain. I didn't put any variable in the advanced tab. I want to use this package like