Get KoolPHP UI with 30% OFF!

Get number of rows in a grid

I need to find the number of rows in a grid whenever it changes.
I thought I could utilize the OnLoad event, but it seems like it occurs before the grid object is initialized.
My goal is to automatically process the first row in a grid if it's the only row in the grid. Otherwise the user will need to select which row to process.
Any ideas how this can be done?
Posted Jan 10, 2018 Kool
Hi Espen,
Please try the following code and let us know if it works for you:
	$grid->ClientSettings->ClientEvents["OnLoad"] = "Handle_OnLoad";
<script type="text/javascript">
	function Handle_OnLoad(sender,args)
		var rows = sender.getMasterTable().getRows();

Please remember to put the function Handle_OnLoad before the $grid->render(). Thanks!
Posted Jan 10, 2018 Kool -