jQuery UI Widgets › Forums › Grid › Export data from json data
Tagged: grid
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 1 month ago.
-
Author
-
Hi.
i have 1 file php return json same :<?php #Include the connect.php file include('connect.php'); #Connect to the database //connection String $connect = mysql_connect($hostname, $username, $password) or die('Could not connect: ' . mysql_error()); //Select The database $bool = mysql_select_db($database, $connect); if ($bool === False){ print "can't find $database"; } if (isset($_GET['update'])) { // UPDATE COMMAND $update_query = "UPDATE `employees` SET `FirstName`='".$_GET['FirstName']."', `LastName`='".$_GET['LastName']."', `Title`='".$_GET['Title']."', `Address`='".$_GET['Address']."', `City`='".$_GET['City']."', `Country`='".$_GET['Country']."', `Notes`='".$_GET['Notes']."' WHERE `EmployeeID`='".$_GET['EmployeeID']."'"; $result = mysql_query($update_query) or die("SQL Error 1: " . mysql_error()); echo $result; } else { $pagenum = $_GET['pagenum']; $pagesize = $_GET['pagesize']; $start = $pagenum * $pagesize; $query = "SELECT SQL_CALC_FOUND_ROWS * FROM employees LIMIT $start, $pagesize"; $result = mysql_query($query) or die("SQL Error 1: " . mysql_error()); $sql = "SELECT FOUND_ROWS() AS `found_rows`;"; $rows = mysql_query($sql); $rows = mysql_fetch_assoc($rows); $total_rows = $rows['found_rows']; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $employees[] = array( 'EmployeeID' => $row['EmployeeID'], 'FirstName' => $row['FirstName'], 'LastName' => $row['LastName'], 'Title' => $row['Title'], 'Address' => $row['Address'], 'City' => $row['City'], 'Country' => $row['Country'], 'Notes' => $row['Notes'] ); } $data[] = array( 'TotalRows' => $total_rows, 'Rows' => $employees ); echo json_encode($data); }?>
i want export ROWS of JSON file to CVS but dont use jqxgrid load .
How can do it. Thank for helpHi nguyentran,
You can populate the Grid from your JSON and then call the “exportdata” method passing the required parameters. The first parameter should be “csv”. For example about exporting data using jqxGrid, please look at – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/dataexport.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comi can do this but i dont want have gridview . i want export direct json
can u help me peter? thank u so much
Hi nguyentran,
Well, you cannot use the Grid’s Export capabilities without a Grid. If you wish, export the Grid’s data and then remove the Grid from your web page by calling the Grid’s destroy method.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.