Page 1 of 5 12345 LastLast
Results 1 to 10 of 41

Thread: Changing color of listview rows according to status

  1. #1
    edanb is offline Senior Member
    Join Date
    Dec 2008
    Posts
    25

    Default Changing color of listview rows according to status

    Hi. How would I go about adding a feature that the rows in the listview of a certain module (not all) would change color depending on the status of the record. For example a new lead row would be green, a converted lead blue, etc.

    Is there a simple way to do this with metadata?
    If not, could you point me to the right files that need to be changed in the core?

    Thanks!

  2. #2
    edanb is offline Senior Member
    Join Date
    Dec 2008
    Posts
    25

    Default Re: Changing color of listview rows according to status

    Anyone got any ideas about this?

  3. #3
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Changing color of listview rows according to status

    You could look into using a process_record logic hook to add some code to the status field to change the color.

    Maybe add some javascript to change the style of the parent TR
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  4. #4
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

    Talking Re: Changing color of listview rows according to status

    Hi!

    It should be something like that:

    Need to change core files
    Attached Images Attached Images  
    Last edited by letrium; 2009-01-26 at 02:18 PM. Reason: duplicate message

  5. #5
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Changing color of listview rows according to status

    Look at the include/ListView folder
    There is the template ListViewGeneric.tpl.
    Create new template using it that will do whatever you like.
    Create custom vlew for the list view of your module(actually what verion sugar?).
    Override the listViewProcess() function and pass the template to the setup() method.
    This is just by glancing at the 5.2.0 code ...

    p.s.
    No core files changes !
    In my humble opinion, through my experience with
    SugarCRM 5.x.x I haven't seen need for core changes other than genuine bugs.
    All code could be written completely in the custom folders.Well I had to do one trick though.
    My module objects had to extend the classes from the custom folders rather than the opposite.
    This could be avoided but then there is need to refactor a lot of the sugar code that does inclusions based on the metadata ... (anyway)
    Last edited by ivolator; 2009-01-26 at 08:24 PM.
    May the source be with you!

    A message from the Dark Side there is ...
    Be done in sugarcrm, no core changes should. Hmmmmmm.
    ...


    Teams For The Masses
    Video Demo of CETeams module

    SimpleCaptcha - A Captcha for SugarCRM 5.2.0x


    Password Resetting For SugarCRM CE PRO and ENT 5.2.0x

  6. #6
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

  7. #7
    piccirm is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    83

    Default Re: Changing color of listview rows according to status

    this is a very interesting possibility that could give a great benefit to Sugar

    Can you please add more detailed "howto" intructions ?
    In particular how to Override the listViewProcess() function

    tks

  8. #8
    Mithun's Avatar
    Mithun is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    India
    Posts
    236

    Default Re: Changing color of listview rows according to status

    Actually I really want what the letrium's attachment picture look like.
    Can any one add more detailed description?
    Do I need to go for logic hook way or template modification way?
    Mithun P Sreedharan
    ITFlux Inc
    38030 Stenhammer Dr
    Fremont
    CA, USA - 94536
    Phone : (510)-792-8897
    Fax : (408)-877-1588
    For further queries mail to mithun@itflux.com

  9. #9
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Changing color of listview rows according to status

    Quote Originally Posted by Mithun View Post
    Actually I really want what the letrium's attachment picture look like.
    Can any one add more detailed description?
    Do I need to go for logic hook way or template modification way?
    The logic_hook process_record will enable you to set the color for a specific field for all rows.
    The new template will enable you to set the color for an entire row.
    Both are upgrade safe.
    Regarding the new template you need to create a custom view.list.php for the module, Specify a new ListView class, which extends the defaul ListViewSmart and inside that specify a new template.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  10. #10
    Mithun's Avatar
    Mithun is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    India
    Posts
    236

    Default Re: Changing color of listview rows according to status

    Thank you!!

    I selected the logic hook way and used JavaScript to add a class to the row
    Mithun P Sreedharan
    ITFlux Inc
    38030 Stenhammer Dr
    Fremont
    CA, USA - 94536
    Phone : (510)-792-8897
    Fax : (408)-877-1588
    For further queries mail to mithun@itflux.com

Page 1 of 5 12345 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Color Calendar Events based on status
    By kblackwell in forum Developer Help
    Replies: 1
    Last Post: 2008-08-08, 10:34 PM
  2. Blank rows in ListView
    By jezz in forum Help
    Replies: 2
    Last Post: 2008-01-24, 11:15 PM
  3. change listview color
    By souza in forum Help
    Replies: 3
    Last Post: 2007-09-12, 10:51 PM
  4. Changing background color...
    By ensiate in forum Help
    Replies: 0
    Last Post: 2005-12-14, 04:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •