If you had this

if(data == 'false')

then this is comparing the data to a string of false, if you want to check
for a true or false then you need to remove the single quotes so that it is.

if(data == false)



Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+:  http://plus.google.com/113032480415921517411



On Wed, Jan 15, 2014 at 5:55 PM, Anthony Doherty <anthony...@gmail.com>wrote:

>
> Hi Andrew
> Thanks for getting back to me.
>
> I found the problem. The if statement did not like the word 'false' so I
> changed it to a number 1 and it worked.
>
> I believe it has something to do with the SQL db but because I inherited
> the db there was not much I can change
>
> Thanks for getting back to me
>
> Anthony
>
> Sent from my iPhone
>
> > On 14 Jan 2014, at 22:44, Andrew Scott <andr...@andyscott.id.au> wrote:
> >
> >
> > Anthony,
> >
> > Have you thought about a few debugging options here? First you could do
> >
> > console.log(data) and see what is contained in the data, the other option
> > is to use the debugging tools in the browser to line debug and see what
> is
> > happening.
> >
> > Regards,
> > Andrew Scott
> > WebSite: http://www.andyscott.id.au/
> > Google+:  http://plus.google.com/113032480415921517411
> >
> >
> >
> > On Wed, Jan 15, 2014 at 9:35 AM, Anthony Doherty <anthony...@gmail.com
> >wrote:
> >
> >>
> >> Hi Guys,
> >> I have this custom rendering applied from this site
> >>
> >>
> http://alagad.com/2010/03/31/ask-an-alagadian-how-can-i-style-a-cell-in-lt-cfgrid-gt-based-on-the-data-it-contains/
> >>
> >> But its only rendering everything in the first style - it wont change
> the
> >> style based on the IF statement.
> >> Below is my code:
> >> <script>
> >>    formatStatus = function(data,cell,record,row,col,store) {
> >>            if (data == 'false')
> >>              {
> >>              cell.css = 'status1';
> >>              }
> >>            else
> >>              {
> >>              cell.css = 'status2';
> >>              }
> >>        return data
> >>
> >>    }
> >>    formatCells = function() {
> >>        theGrid = ColdFusion.Grid.getGridObject('grid1');
> >>        cm = theGrid.getColumnModel();
> >>        cm.setRenderer(9,formatStatus);
> >>    }
> >> </script>
> >> <style>
> >>    .status1{border:0px solid #000; background-color:#66FF66;  }
> >>    .status2{border:0px solid #000; background-color:#ffff00;  }
> >> </style>
> >>
> >> So you can see i have 2 styles - my problem is everything is getting
> >> rendered in status1 no matter if i change the IF statement.
> >> Its as if there is a problem with the If statment.
> >>
> >> If someone could help as i have to do a presentation on this tomorrow
> and
> >> i have only realised during a practice run of the demo!
> >>
> >> Thanks
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357427
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to