Forum
10:44
10/03/2010
I have a table with 6 columns and I am able to update the records. If I add a new column in the table and I update the record (using inline editing, or adding a new record) it shows updated in the grid but when I refresh the page it has not updated. If I delete the additional column it updates.
Help please. I am using JQuery Grid 3.6.4
My Quode:
<?php
require_once "../jq-config.php";
// include the jqGrid Class
require_once ABSPATH."php/jqGrid.php";
// include the driver class
require_once ABSPATH."php/jqGridPdo.php";
// Connection to the server
/*$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);*/
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD, array
(PDO::MYSQL_ATTR_MAX_BUFFER_SIZE=>1024*1024*10));
$conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'Select id, STATION, Country, YEAR, MO, D01,F01, F02';
// Set the table to where we add the data
$grid->table = 'daily';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid_dailyrainfall.php');
$grid->addCol(array(
"name"=>"actions",
"formatter"=>"actions",
"editable"=>false,
"sortable"=>false,
"resizable"=>false,
"fixed"=>true,
"width"=>60,
"formatoptions"=>array("keys"=>true)
), "first");
$grid->setGridOptions(array(
"caption"=>"Data Can Be Filterd Below:",
"rowNum"=>50,
"hoverrows"=>true,
"rowList"=>array(50,100,150),
"sortname"=>"id",
"altRows"=>true,
"rownumbers"=>true,
"sortable"=>true,
"autowidth"=>true,
"multiselect"=>true,
"scroll"=>1,
"shrinkToFit"=>false
));
$grid->setSelect("Country", "SELECT DISTINCT country_id, Country FROM countries ORDER BY 2", true, true, true, array(""=>"All"));
// Enable navigator
$grid->navigator = true;
// Enable toolbar searching
$grid->toolbarfilter = true;
$grid->setFilterOptions(array("stringResult"=>true,"editable"=>false));
// We tell that the primary key is not serial, which should be inserted by the user
$grid->serialKey = true;
// Enable only adding
$grid->setNavOptions('navigator', array("excel"=>true,"add"=>true,"edit"=>true,"del"=>true,"view"=>true, "search"=>true));
// Close the dialog after the record is added
$grid->setNavOptions('add',array("closeAfterAdd"=>true,"reloadAfterSubmit"=>true));
$grid->setNavOptions('edit',array("closeAfterEdit"=>true,"reloadAfterSubmit"=>true));
$grid->setNavOptions('del',array("closeAfterDel"=>true,"reloadAfterSubmit"=>true));
// Enjoy
$grid->tarns = false;
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
$conn = null;
?>
Most Users Ever Online: 715
Currently Online:
43 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66