Forum


22:05

20/08/2009

The following code is not deleting the selected entries. What am I doing wrong, please.
require_once '../includes/jquery/jq-config.php';
// include the jqGrid Class
require_once "../includes/jquery/php/jqGrid.php";
// include the PDO driver class
require_once "../includes/jquery/php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// 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 lead_id,lastname,firstname,phone,concat_ws(', ',streetno,street,suburb,town) as addr,ddate from ".$filterfile;
// Set the table to where you add the data
$grid->table = $filterfile;
$grid->setPrimaryKeyId('lead_id');
// set the ouput 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('getaLeads.php');
// Set grid caption using the option caption
$grid->setGridOptions(array(
"caption"=>"Leads",
"rowNum"=>12,
"sortname"=>"lastname",
"rowList"=>array(12,30,50),
"multiselect"=>true,
"height"=>270,
"width"=>1000
));
// Change some property of the field(s)
$grid->setColProperty("lead_id", array("label"=>"ID", "width"=>20, "hidden"=>true));
$grid->setColProperty("lastname", array("label"=>"Last Name", "width"=>190));
$grid->setColProperty("firstname", array("label"=>"First Name", "width"=>100));
$grid->setColProperty("phone", array("label"=>"Phone", "width"=>80));
$grid->setColProperty("addr", array("label"=>"Address", "width"=>250));
$grid->setColProperty("ddate", array("label"=>"Date", "width"=>100, "formatter"=>"date"));
$dblclick = <<<ONDOUBLECLICK
function(rowid) {
var rowdata = $("#aleadlist").getRowData(rowid);
var leadid = rowdata.lead_id;
viewlead(leadid);
}
ONDOUBLECLICK;
$grid->setGridEvent('ondblClickRow',$dblclick);
// enable form editing
$grid->navigator = true;
$grid->setNavOptions('navigator',array('add'=>false,'edit'=>false));
$grid->setNavOptions('del',array("jqModal"=>false));
// Run the script
$grid->renderGrid('#aleadlist','#aleadpager',true, null, null, true,true);
Most Users Ever Online: 715
Currently Online:
52 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