Announcement

Collapse
No announcement yet.

GRID BUG in sc_field_color and sc_field_style functions

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GRID BUG in sc_field_color and sc_field_style functions

    SOLVED ! Hi Friends,
    as a registered customer I'm not able to send in a BUG to the NetMake's ticketing directly (WHAT ???), so I write it here, please check if it is only for me or a general bug:
    I want to colorize grid fields based with database field values, color values are stored correctly in a db field. Actual documentation of sc_field_color and sc_field_style macros tells (with examples) that it is possible to use variables as parameter for these functions (not only direct color codes).
    If I use
    Code:
    sc_field_color("FieldName", "red");
    or
    Code:
    sc_field_color("FieldName", "#FFF000");
    both version work well.
    If I use
    Code:
    sc_field_color("FieldName1", "FieldName2");
    or
    Code:
    sc_field_color("FieldName1", {FieldName2});
    none of them work. The generated html shows the
    Code:
    "<div style=background-color:fieldname2;"
    tag for the element.
    If it is experienced by others, please inform the company about the error.
    Br
    zsimre
    Last edited by zsimre; 03-14-2015, 09:37 AM. Reason: Solved !

  • #2
    and what what type of field is your {fieldname2} did you find something called "html color"?

    did you try sc_field_color("FieldName1", "{FieldName2}");
    or
    sc_field_color("FieldName1", [FieldName2]);
    or
    sc_field_color("FieldName1", FieldName2);
    or
    sc_field_color("FieldName1", "#{FieldName2}");

    in which event you are putting that? onRecord? grid+onRecord, otherwise it will not work... also is your fieldname2 defined? did you try as global instead and try to add it manually when grid start?
    I guess it is not related to sc

    Comment


    • #3
      Thanks MikeDE,
      what i did is simple to use the manual's examples...(with my fields)

      Originally posted by MikeDE View Post
      and what what type of field is your {fieldname2} did you find something called "html color"?
      Of course the fieldname2 is a database field, content filled with the query assigned to the grid, db field type is varchar(10)

      Originally posted by MikeDE View Post
      in which event you are putting that? onRecord? grid+onRecord, otherwise it will not work... also is your fieldname2 defined? did you try as global instead and try to add it manually when grid start?
      I guess it is not related to sc
      Yes, it is called in onRecord event. I'll try your proposed solutions, than i'll provide rerults

      Comment


      • #4
        there is field type called "html Color" have a look

        Comment


        • #5
          Originally posted by MikeDE View Post
          there is field type called "html Color" have a look
          Hi MikeDE, in my version (8.00.0029) there is no html Color field type , only similar is "html Image" what is available. On database level (mysql 5.5) also not "html Color" field type.
          If you try the sc_field_style function on gridnRecord, it works stupidly: in final rendered html the element background color tag will be exactly the string with small cases (!!!) what you assigned in the calling function....

          Comment


          • #6
            and yesss !!!
            the winner is:
            Originally posted by MikeDE View Post
            did you try sc_field_color("FieldName1", "{FieldName2}");
            MikeDE, BIG THANKS !!!

            Comment


            • #7
              glad it helped

              you should also have a look at html color dude
              it is there when you use form entry field
              see how it will be saved to db
              user will have power to select color from a nice color palette

              cheers

              Comment

              Working...
              X