In this example, we would like to show you how to insert KoolAjax's UpdatePanel into KoolGrid's Template.
span style="color: #ff0000;">"/KoolAjax/koolajax.php";
$koolajax->scriptFolder = $KoolControlsFolder."/KoolAjax""/KoolGrid/koolgrid.php""/KoolGrid/ext/datasources/MySQLiDataSource.php""/KoolCalendar/koolcalendar.php"//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds->SelectCommand = "select customerName,country from customers order by customerNumber desc";
$ds->InsertCommand = "";// If you set the Insert Command, the new data will be inserted to database.
"grid");
$grid->scriptFolder = $KoolControlsFolder."/KoolGrid";
$grid->styleFolder="default""655px""";
$html .="<table>";
$html .="<tr>";
$html .="<td style='padding:3px;width:50px;'>Continent:</td>";
$html .="<td style='padding:3px;'>";
//Continent
$html .= "<select id='selContinent' name='selContinent' style='width:100px' onchange='do_update()'>";
$html .= "<option value='--'>--</option>""select ContinentID,ContinentName from kcb_tbcontinents""selContinent""selContinent"]==$row["ContinentID""<option value='".$row["ContinentID"]."' ""selected":"").">".$row["ContinentName"]."</option>";
}
$html .= "</select>";
$html .="</td>";
$html .="</tr>";
$html .="<tr>";
$html .="<td style='padding:3px;'>Country:</td>";
$html .="<td style='padding:3px;'>";
//Country
"selContinent""selContinent"]!="--")
{
$html .= "<select id='selCountry' name='selCountry' style='width:100px' >";
$html .= "<option value='--'>--</option>""select CountryName from kcb_tbcountries where ContinentID=""selContinent""selCountry""selCountry"]==$row["CountryName""<option value='".$row["CountryName"]."' ""selected":"").">".$row["CountryName"]."</option>";
}
$html .= "</select>""<select id='selCountry' name='selCountries' style='width:100px' disabled></select>";
}
$html .="</td>";
$html .="</tr>";
$html .="</table>""myPanel");
$myPanel->content = $html;
$myPanel->setLoading("../../../../KoolControls/KoolAjax/loading/5.gif""";
$html .= "<div style='font-size:12px;font-weight:bold;margin-bottom:10px;'>Inserting a new customer</div>";
$html .="<table>";
$html .="<tr>";
$html .="<td valign='top' style='padding:3px;padding-top:4px;width:50px;'>Name:</td>";
$html .="<td valign='top' style='padding:3px;padding-top:4px;width:380px;'>";
$html .="<input type='text' id='txtName' name='txtName'>";
$html .="</td>";
$html .="<td valign='top'>""</td>";
$html .="</tr>";
$html .="</table>";
$html .= "<div style='font-size:12px;font-weight:bold;margin-top:5px;margin-bottom:5px;'>";
$html .= "<input type='button' value ='Confirm' onclick='validate_and_confirm(this)'>";
$html .= "<input type='button' value ='Cancel' onclick='grid_cancel_insert(this)'>";
$html .= "</div>""customerName""txtName"],"country""selCountry""template""OnConfirmInsert"] = "Handle_OnConfirmInsert"'myPanel_is_updating'"form1" method="post""text/javascript""myPanel_is_updating"//Check if country is selected.
"selCountry""txtName""")
{
alert("Please insert a name""""--")
{
alert("Please choose a country!""In the real application, new customer information will be inserted into database."