The HTML code (second snippet) seem not to be generated from the PHP code in the first snippet since PHP code says id='gridRow' (single quotes) and HTML generated is id="gridRow" (double quotes)
I would code like this (all HTML attributes in double quotes):
echo "<tr id=\"gridRow\">
<td >$count</td>
<td> <input type=\"checkbox\" onClick=\"selectAndUpdate('$row1[size]')\"></td>
<td> {$row1[SerialNo]}</td>
<td> {$row1[InHouseBranding]}</td>
<td> {$row1[BrandCode]}</td>
<td> {$row1[size]}</td>
<td> {$row1[Pattern]}</td>
<td> {$row1[EntryStatus]}</td>
</tr>";
Maybe my reply is not directly related to your question but the coding should be correct at first place to make it easier to spot the cause of the problem.