|
Title: getting datagrid data from php Post by: my888 on April 20, 2015, 06:15:37 PM Hi,
I have the following datagrid in my html file: <table id="dg" title="Service Items" toolbar="#toolbar" pagination="true" idField="sequence" rownumbers="true" fitColumns="true" singleSelect="true"> <thead> <tr> <th field="date" width="10" >Date of Service</th> <th field="code" width="5" >Item</th> <th field="desc" width="30" >Description</th> <th field="amount" width="7" >Amount</th> </tr> </thead> </table> . . . $(function(){ $('#ff').form({ url:'form1_proc.php', . . How do I read this datagrid data from form1_proc.php file? Title: Re: getting datagrid data from php Post by: stworthy on April 20, 2015, 08:07:17 PM You can call 'getRows' method to get all the rows and then post them to your server.
Code: var rows = $('#dg').datagrid('getRows');Title: Re: getting datagrid data from php Post by: my888 on April 21, 2015, 10:32:55 PM thank you and I found a solution and that is how I have done:
in html: 1) create a hidden field 2) stringify the datagrid array 3) assign stringify data to the hidden field in php: $temp = html_entity_decode($_REQUEST['myHiddenField']); $dg = json_decode($temp); foreach ($dg as &$dg1) { $dg1=get_object_vars($dg1); $date = $dg1['date']; . . } |