Data view showing template as well

I have the following html structure:

		<!-- dataview container -->

		<div id='dvdataviewBkgItem' style='width:295px; height:550px;'></div>

		
		<!-- dataview template  -->	

		<div id='dvtmpltBkgItem'>
			<table style='font-family:Arial; font-size:12px;'>
			       <tr>
					<td class='form_cell'>Type : </td>
					<td style= 'color:rgb(10,70,93);'>#bkgitmtype#</td>
				</tr>
				<tr>
					<td class='form_cell'>Description: </td>
					<td style= 'color:rgb(10,70,93);'><strong>#bkgitmdesc#</strong></td>
				</tr>
				<tr>
					<td class='form_cell'>City: </td>
					<td style= 'color:rgb(10,70,93);'>#bkgitmcity#</td>
				</tr>
				<tr>
					<td class='form_cell'>Start Date : </td>
					<td style= 'color:rgb(10,70,93);'>#bkgitmstartdate#</td>
				</tr>
				<tr>
					<td class='form_cell'>End Date: </td>
					<td style= 'color:rgb(10,70,93);'>#bkgitmenddate#</td>
				</tr>
				<tr>
					<td class='form_cell'>Status: </td>
					<td style= 'color:rgb(10,70,93);'>#bkgitmstatus#</td>
				</tr>
				<tr>
					<td class='form_cell'>Price: </td>
					<td style= 'color:rgb(10,70,93);'>#bkgitmagentprice#</td>
				</tr>
			</table>
		</div>

I then have the following code snippets:

				dvBkgItem = new dhtmlXDataView({
					container:'dvdataviewBkgItem',
					select:true
				});				

				dvBkgItem.define('type',{
					template:'html->dvtmpltBkgItem',
                                        width:295,
                                        height:300,
				});

						dvBkgItem.add({
							bkgitmtype: CurrBkgItem,
							bkgitmdesc: hotelName,
							bkgitmcity: cityName,
							bkgitmstartdate: rqfromdate,
							bkgitmenddate: rqtodate,
							bkgitmstatus: 'Not Requested',
							bkgitmagentprice: bkgitmPrice
						});

Everything works fine BUT the template ALSO appears in the dataview.

Please can you tell me what I’m doing wrong.

Thanks

Purvez

Probably you meant “Everything works fine BUT the template ALSO appears NEXT the dataview.”

Try to set style=‘display:none’ for the template container:

Thanks for that Alexandra. Your example in the documentation does not show that we need to set the ‘display:none’ and I was therefore wondering if I had done something wrong.

Purvez