Get KoolPHP UI with 30% OFF!

GridTableView refresh from javascript

Pasquale Polisi
Hi
how I can refresh a GridTableView from javascript ?
gridtableview.refresh() does not seem to work
Thanks
Posted Dec 14, 2015 Kool
Anthony Amolochitis
When you create the koolgrid you give it a name.
Ex.
$grid = new KoolGrid("gridname");
//  ... php code here ...

Now you need a javascript method to call the refresh event when you want the grid to refresh/reload.
function RefreshGrid()
{
    // I commented this out, but thought I'd leave this here if you wanted to attach data to the grid.  
    // If your grid has identifiers that help load data, like an order id to load an order's information, then you will need to attach the
    // data and access it via post variable on the server side to assist in loading the correct data.
    // gridname.attachData( "somevar" , someValue ) ; 
    gridname.refresh();
    gridname.commit();
}
Posted Dec 14, 2015 , edited Dec 14, 2015 Kool
Pasquale Polisi
It's a GridTableView not Grid
$gridtableview = new GridTableView();
$gridtableview->Name="gridtableview";
in DOM there isn't a gridtableview object to refresh
Posted Dec 14, 2015 Kool
Anthony Amolochitis
Could you place your javascript here?
I did this test found in their documentation and it worked.
http://doc.koolphp.net/Controls/KoolGrid/Javascript/GridTableView/index.php#refresh
var _mastertable = SomeGrid.getMasterTable();
_mastertable.refresh();
SomeGrid.commit();
Posted Dec 14, 2015 Kool -