EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
November 06, 2025, 06:45:43 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
getting datagrid data from php
Pages: [
1
]
« previous
next »
Print
Author
Topic: getting datagrid data from php (Read 7732 times)
my888
Newbie
Posts: 3
getting datagrid data from php
«
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?
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: getting datagrid data from php
«
Reply #1 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');
$.post({
url: ...,
data: ..., // stringify the rows
//...
});
Logged
my888
Newbie
Posts: 3
Re: getting datagrid data from php
«
Reply #2 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'];
.
.
}
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...