Camillia
asked on
How not to hard code this value OR add a check for null?
I made this Javascript change in this new project and hard coded a value. I didnt know this JS code is used for other sections as well. So, now this hardcoded value is NULL for another page...
How can either not hard code this OR do a check for a null?
-- you see that "ctl00_Body_grdOrderItems" .... for another page, that value is "ctl00_Body_grdAllOrders" ... so this hardcoded value wont do it...
How can either not hard code this OR do a check for a null?
-- you see that "ctl00_Body_grdOrderItems"
function EditSelectedObject (sender, eventArgs)
{
var masterTable = $find("ctl00_Body_grdOrderItems").get_masterTableView();
....
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it should be if(grd == null)
grd = null sets the value of grd to null
grd == null means grd equals null
grd = null sets the value of grd to null
grd == null means grd equals null
Yes, (grd != null) means IS NOT null, but you would need (grd == null) to check if grd IS null
ASKER
if(grd != null)
That means is grd IS NOT null? if it's null...i want to execute the next statement..so it should be...
if (grd = null) .... no?