Get KoolPHP UI with 30% OFF!

Using an inserting template causes colum validators to lose effect.

Abraham
hi there
i have been playing arround with the inserting template and i found that colum validator lose effect i mean validators wont validate anything...
is there a way to get back validators to work??.
thanks.
Posted Sep 11, 2015 , edited Sep 11, 2015 Kool
Peter
Hi Abraham,
When you use the GridTemplate for either editing or inserting, we assume that you take full control of what user input and how they will input. That's why you need to validate the user's input by yourself. You can write your own javascript function to validate and call them on the OnBeforeConfirmInsert or OnBeforeRowConfirmEdit.
Posted Sep 12, 2015 , edited Sep 12, 2015 Kool
Abraham
Hi there Pater..
so... then i should code my own validators meessages header on my form template.. and for that i need to post some data after the javascript validate(this); right??...
so wich one was the append data function in java script for the grid..?? i think its called before a grid.commint(); or something...
Posted Sep 15, 2015 Kool
Peter
Please write your own javascript function to check your custom form. Then in the handle function of OnBeforeConfirmInsert event, you call your function to validate user input. If everything is good, return true to let KoolGrid continue process to post value to server(via ajax). If not, return false to cancel the submission. In your custom form, you may contain some place for error notification, so that your javascript validate function can put error message there for user to know what they did wrong.
Posted Sep 16, 2015 Kool
Peter
To be simple, here is the detail instruction:
<?php
...
	$grid->ClientSettings->ClientEvents["OnBeforeConfirmInsert"] = "Handle_OnBeforeConfirmInsert";
...
?>
...
<script type="text/javascript">
	function Handle_OnBeforeConfirmInsert(sender,args)
	{
		//Write your own form validation function here
		if(everything is great)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
</script>
Posted Sep 16, 2015 Kool -