Get KoolPHP UI with 30% OFF!

Example on how to create a custom form for editing and inserting

Scott
Does there exist a code example on how to configure KoolGrid to use a custom HTML form for editing and Inserting.
I see the option for inline vs form, but nothing for using different HTML to render the form.
Posted Aug 26, 2015 Kool
Abraham
Hi there Scott i think you are looking for this:
http://doc.koolphp.net/Controls/KoolGrid/PHP/InsertSettings/index.php#Template
<?php				
	//Create inserting template.
	...
	class MyInsertTemplate implements GridTemplate
	{
		function Render($_row)
		{
			$html  = "<input id='city_input'  name='city_input' type='text' />"; User input
			$html .= "<input type='button' value='Confirm' onclick='grid_confirm_insert(this)'/>"; //Render confirm button.
			$html .= "<input type='button' value='Cancel' onclick='grid_cancel_insert(this)'/>"; //Render cancel button.
			return $html;
		}
		function GetData($_row)
		{
			return array("city"=>$_POST["city_input"]);
		}		
	}
	...
	$grid->MasterTable->InsertSettings->Mode = "Template";
	$grid->MasterTable->InsertSettings->Template = new MyInsertTemplate();
	...
 
?>
Posted Aug 26, 2015 Kool -
Peter
In addition to Abraham good answer, GridTemplate can be used for both Inserting and Editing.
Here is a small working example which uses GridTemplate:
http://demo.koolphp.net/Examples/KoolGrid/Advanced/Ajax_Template/index.php
In above example, we build a custom Inserting with capability of loading countries list via ajax for user to select.
Hope that help.
Regards,
Peter
Posted Aug 27, 2015 Kool
Daniel
Hey, I was reading about KoolReport and how it gives full control over PHP reporting without exposing your data, and it got me thinking about taking a fun break from work. Later, I stumbled onto billionairespin casino, and the bonuses for players from Canada immediately caught my attention. I tried a few spins on their Mega Reels slot, hit a short losing streak, then risked a bigger spin and landed a solid win. That swing made the session fun and surprisingly rewarding.
Posted Jan 17 Kool
Alex
Estaba en Granada cuando vi una publicidad que me dio buenas vibraciones tras una mala racha. Estaba perdiendo de forma constante y ya no sabía qué probar para ganar. Al entrar en https://playjonny.com.es/app desde mi teléfono, todo empezó a ir sobre ruedas. Logré una ganancia que no solo tapó los agujeros de mi cuenta, sino que me dio un beneficio neto muy rico. Estoy muy contento con la variedad de slots y el pago.
Posted 23 hrs ago , edited 23 hrs ago Kool