ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: mewbie on January 05, 2018, 02:51:22 pm
-
Hello Paramvir,
Sorry to make a thread again on the same setup,
but all of them now can be seen in here, could you take a look?
http://masterplan.pw/
Right now remote sorting is not working and acting funny if you click at the header and I suspected it mixed up with remote filtering API (and perhaps remote paging),
also I need to make header filter with 'AND' filter while toolbar filter with 'OR', can it be done? right now can only be done with one of them.
The other thing is the extra column to fill the flex detail grid,
I couldn't reproduce in the plunkr even with the same settings,
maybe it has something to do with javascript-detect-element-resize/jquery.resize.js ?
Here's the updated plurk (cannot reproduce) :
https://plnkr.co/edit/LOvrSsYMvqgaUo4BXyj9?p=preview
and here's my API code :
// other settings for job and classes
// Execute job to get all tickets
if($job == 'get_tickets')
{
if (isset($_GET["pq_curpage"]) && isset($_GET["pq_rpp"]) ){
$filterQuery = "";
$filterParam = array();
if ( isset($_GET["pq_filter"]))
{
$pq_filter = $_GET["pq_filter"];
$dsf = FilterHelper::deSerializeFilter($pq_filter);
$filterQuery = $dsf->query;
$filterParam = $dsf->param;
}
if (isset($_GET["pq_sort"])) {
$pq_sort = $_GET["pq_sort"];
$sortQuery = SortHelper::deSerializeSort($pq_sort);
}
$pq_curPage = $_GET["pq_curpage"];
$pq_rPP=$_GET["pq_rpp"];
$sql = "Select count(*) from noc_tickets";
$stmt = $dbh->query($sql);
$total_Records = $stmt->fetchColumn();
$skip = ($pq_rPP * ($pq_curPage - 1));
if ($skip >= $total_Records)
{
$pq_curPage = ceil($total_Records / $pq_rPP);
$skip = ($pq_rPP * ($pq_curPage - 1));
}
// Get tickets
$sql ="SELECT * FROM noc_tickets ORDER BY `TicketNo` DESC limit ".$skip." , ".$pq_rPP." ".$filterQuery;
if ( isset($_GET["pq_filter"]))
{
$sql = "SELECT * FROM noc_tickets ORDER BY `TicketNo` DESC" .$filterQuery;
}
if ( isset($_GET["pq_filter"]))
{
$sql ="SELECT * FROM noc_tickets".$sortQuery;
}
$stmt = $dbh->prepare($sql);
$stmt->execute($filterParam);
if (!$stmt){
$result = 'error';
$message = 'query error';
} else {
$result = 'success';
$message = 'query success';
$mysql_data = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
}
// Prepare data
$data = array(
"result" => $result,
"message" => $message,
"totalRecords" => $total_Records,
"curPage" => $pq_curPage,
"data" => $mysql_data,
);
// Convert PHP array to JSON array
$json_data = json_encode($data);
print $json_data;
}
Thank you
-
Just want to make a quick update for progress so far,
- sorting, filtering, and paging remotely is already working, except for DATE (duration) filtering, cannot adjust with yyyy-mm-dd format.
- still trouble with combining toolbar and header filtering functionality
- still trouble with detail grid extra flexed column
thanks
-
Please avoid adding multiple questions / issues in a single post, it's one question per post.
Your last question about remote between filter condition has been split and answered here: https://paramquery.com/forum/index.php?topic=2506.0
The encircled part of the grid in your screenshot is not a column, but background of header. If you want to avoid empty space, please use width: 'flex' or scrollModel: {autoFit: true}
-
Works like a charm, thank you very much