5 Replies Latest reply on Oct 1, 2006 1:16 PM by azadisaryev

    Changing datagrid display

    Level 7
      I have a web site when the designed can either 'hide' a project so it can
      only be view in house by the design team or set it 'live' so the client can
      view it. I have it set to 1 (live) or 0 (hidden)
      I have a datagrid to display all the projects created and I would like to
      show if the project is live or not, but it shows either the 1 or 0. I would
      like it to show 'yes' or 'no'. How can I set a conditional to say 'if 1 then
      yes else no' and have that display? I tried to set a variable first that
      does the conditional evaluation, but the grid column will not recognize it.

      --
      Wally Kolcz
      Developer / Support


        • 1. Re: Changing datagrid display
          Level 7
          I would think it would be best to do it in the query. Depending on which
          database server you are using I would think you should be able to do
          something in the select statement.


          "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
          news:efp0jn$fbh$1@forums.macromedia.com...
          >I have a web site when the designed can either 'hide' a project so it can
          >only be view in house by the design team or set it 'live' so the client can
          >view it. I have it set to 1 (live) or 0 (hidden)
          > I have a datagrid to display all the projects created and I would like to
          > show if the project is live or not, but it shows either the 1 or 0. I
          > would like it to show 'yes' or 'no'. How can I set a conditional to say
          > 'if 1 then yes else no' and have that display? I tried to set a variable
          > first that does the conditional evaluation, but the grid column will not
          > recognize it.
          >
          > --
          > Wally Kolcz
          > Developer / Support
          >


          • 2. Re: Changing datagrid display
            Level 7
            I am using MySQL, but don't know how to do that in the query.

            SELECT P.project_id, P.title, P.live, P.projstatus, P.date, C.company
            FROM project P LEFT OUTER JOIN client C ON P.client = C.username
            WHERE P.dirname='#arguments.username#'


            • 3. Re: Changing datagrid display
              Level 7
              I am not sure exsacaly but I think something like this might work. You may
              need to referance the MySQL docs.

              SELECT P.project_id, P.title, P.projstatus, P.date, C.company,
              Case When P.live = 1 Then 'Yes'
              When P.live = 0 Then 'No' End as live
              FROM project P LEFT OUTER JOIN client C ON P.client = C.username
              WHERE P.dirname='#arguments.username#'


              "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
              news:efp204$goc$1@forums.macromedia.com...
              >I am using MySQL, but don't know how to do that in the query.
              >
              > SELECT P.project_id, P.title, P.live, P.projstatus, P.date, C.company
              > FROM project P LEFT OUTER JOIN client C ON P.client = C.username
              > WHERE P.dirname='#arguments.username#'
              >


              • 4. Re: Changing datagrid display
                Level 7
                Wow, that worked. Thanks.


                • 5. Re: Changing datagrid display
                  azadisaryev Level 1
                  you can also try
                  SELECT P.project_id, P.title, P.projstatus, P.date, C.company, IF(P.live = 1, 'yes', 'no')
                  FROM project P LEFT OUTER JOIN client C ON P.client = C.username
                  WHERE P.dirname='#arguments.username#'

                  haven't tried this either, but technically should work...