Get KoolPHP UI with 30% OFF!

KoolGrid InLine Editing

Emmanuel
Hello, new in PHP and trying out KoolGrid Inline editing. I'm connecting to Oracle Database and generating the KoolGrid successfully. However, when doing the InlIne edit in the KoolGrid and confirming it, the data does not get updated. Not sure if the data is being passed to the UpdateCommand correctly. I'm following the example below.
$ds->UpdateCommand = "update orders set orderDate='@orderDate', status='@status', comments='@comments' where orderNumber='@orderNumber'";
Posted Sep 14, 2016 Kool
Anthony Amolochitis
Maybe you need to include the database name in your update command. Also, you field names might be case sensitive as well. Plus make sure you are connected to the database too.
ds->UpdateCommand = " UPDATE databasename.orders " .
" SET orderDate='@orderDate' , " .
" status='@status' , " .
" comments='@comments' " .
" WHERE orderNumber='@orderNumber'" ;
Posted Sep 14, 2016 Kool
Emmanuel
I found the issue. KoolGrid is not returning data with dashes correctly to the UpdateCommand. Values are returned with backslash before each dash (e.g. VALUE-XX-YY becomes VALUE\-XX\-YY). Is there any way to work around this without modifying the database values?
Posted Sep 14, 2016 Kool
Anthony Amolochitis
Use an event handler to handle your updates. I created a generic one in the code samples.
http://www.koolphp.net/forum/threads/82.1/koolgrid-with-an-event-handler-class--basic-crud-ops-included-in-the-class.html
Posted Sep 15, 2016 , edited Sep 15, 2016 Kool
Emmanuel
Thank you for the help!... How do I get the row column data from the event handler? Example in below code;
function OnConfirmInsert($tableview,$args)
{
// $tableview: The grid tableview object.
// $args["NewDataItem"]: New dataitem posted back
// $args["Successful"]: Bool value which indicates whether the insert is successful.
$column1data = ;
$column2data = ;
return true;
}
Posted Sep 16, 2016 Kool
Anthony Amolochitis
$args["NewDataItem"]["ColumnName"] = This contains your column info posted
$args["NewDataItem"] = all the ColumnName on the row, including hidden ColumnName
Posted Sep 16, 2016 Kool
Emmanuel
Thanks for the help. I'm almost there! One more question on the OnRowDelete handler, how can i get the row column info?
$args["NewDataItem"]["ColumnName"] does not seem to work.
Posted Sep 16, 2016 Kool
Anthony Amolochitis
$row->DataItem = your data row array
$row->DataItem["ColumnName"] = your current column being deleted
Posted Sep 16, 2016 Kool -
Emmanuel
it's all working now. Thanks a lot Anthony for your great support!!.
Posted Sep 16, 2016 Kool -
Anthony Amolochitis
No problem. The event handler will help you customize your grid behavior in many ways. Read the docs and try other things with it too. You'll be amazed!
Posted Sep 16, 2016 Kool