当前位置: 首页>>代码示例>>PHP>>正文


PHP jqGridRender::renderGrid方法代码示例

本文整理汇总了PHP中jqGridRender::renderGrid方法的典型用法代码示例。如果您正苦于以下问题:PHP jqGridRender::renderGrid方法的具体用法?PHP jqGridRender::renderGrid怎么用?PHP jqGridRender::renderGrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jqGridRender的用法示例。


在下文中一共展示了jqGridRender::renderGrid方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

$(window).resize(function()
{
        $('#eidgrid').fluidGrid({base:'#ui-dialog-title-eid_dialog', offset:-25});
});


CUSTOM;

$grid->setJSCode($custom);


$oper = jqGridUtils::GetParam("oper");
if($oper == "pdf") {
    $grid->setPdfOptions(array(
        "header"=>true,
        "margin_top"=>25,
        "page_orientation"=>"P",
		"header_logo"=>"../../../../../images/Logo_450x123_24bit_color.jpg",
        // set logo image width
        "header_logo_width"=>45,
        //header title
        "header_title"=>"                         Snare/Windows Event ID Report"
    ));
} 

// Enjoy
$summaryrows=array("Seen"=>array("Seen"=>"SUM")); 
$grid->renderGrid('#eidgrid','#eidpager',true, $summaryrows, null, true,true);
$conn = null;
?>
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:30,代码来源:snare_eid.php

示例2: get_main_grid

function get_main_grid()
{
    global $myconn, $customers;
    $myconn->query("SET NAMES utf8");
    //execute the query specifical to your database
    $sth = $myconn->prepare('SELECT CustomerID, CompanyName, ContactName, Phone, City FROM customers');
    $sth->execute();
    // get the data as array. Nothe the the customer array
    // is passed in the select command
    $customers = $sth->fetchAll(PDO::FETCH_ASSOC);
    // end of custom code
    //var_dump($customers);
    // create the array connection
    $conn = new jqGridArray();
    // Create the jqGrid instance
    $grid = new jqGridRender($conn);
    // Write the SQL Query
    $grid->SelectCommand = 'SELECT * FROM customers';
    // Set the table to where you update the data
    $grid->table = 'customers';
    // Set output format to json
    $grid->dataType = 'json';
    $grid->setPrimaryKeyId("CustomerID");
    // Let the grid create the model
    $grid->setColModel();
    // Set the url from where we obtain the data
    $grid->setUrl('grid.php');
    // Set some grid options
    $grid->setGridOptions(array("rowNum" => 10, "height" => 250, "rowList" => array(10, 20, 30), "sortname" => "CustomerID"));
    $grid->setColProperty('CustomerID', array("label" => "ID", "width" => 50));
    $grid->setSubGridGrid("subgrid.php");
    // Enable navigator
    $grid->navigator = true;
    // Enable only editing
    $grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
    // Enjoy
    $grid->renderGrid('#grid', '#pager', true, null, null, true, true);
}
开发者ID:nong053,项目名称:prototype-nnit,代码行数:38,代码来源:grid.php

示例3: PDO

// include the driver class
require_once ABSPATH . "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 CustomerID, CompanyName, ContactName, Phone, City FROM customers';
// Set the table to where you update the data
$grid->table = 'customers';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setPrimaryKeyId('CustomerID');
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "height" => 250, "gridview" => false, "rowList" => array(10, 20, 30), "sortname" => "CustomerID"));
$grid->setColProperty('CustomerID', array("label" => "ID", "width" => 50));
// Set the parameters for the subgrid
$grid->setSubGrid("subgrid.php", array('OrderID', 'RequiredDate', 'ShipName', 'ShipCity', 'Freight'), array(60, 120, 150, 100, 70), array('left', 'left', 'left', 'left', 'right'));
// Enable navigator
$grid->navigator = true;
// Enable only editing
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
开发者ID:nong053,项目名称:prototype-nnit,代码行数:31,代码来源:grid.php

示例4: PDO

require_once ABSPATH . "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");
// Get the needed parameters passed from the main grid
$subtable = jqGridUtils::Strip($_REQUEST["subgrid"]);
$rowid = jqGridUtils::Strip($_REQUEST["rowid"]);
if (!$subtable && !$rowid) {
    die("Missed parameters");
}
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = "SELECT OrderID, ProductID, Quantity, UnitPrice FROM order_details WHERE OrderID=?";
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel(null, array(&$rowid));
// Set the url from where we obtain the data
$grid->setUrl('subsubgrid.php');
// Set some grid options
$grid->setGridOptions(array("width" => 480, "rowNum" => 10, "sortname" => "OrderID", "height" => 'auto', "postData" => array("subgrid" => $subtable, "rowid" => $rowid)));
// Change some property of the field(s)
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
// Enjoy
$subtable = $subtable . "_t";
$pager = $subtable . "_p";
$grid->renderGrid($subtable, $pager, true, null, array(&$rowid), true, true);
$conn = null;
开发者ID:nong053,项目名称:prototype-nnit,代码行数:31,代码来源:subsubgrid.php

示例5: array

        \$("#mne_dialog").ready(function(){
        // Some magic to set the proper width of the grid inside a Modal window
        var modalWidth = \$("#mne_dialog").width();
        var modalHeight = \$("#mne_dialog").height() - 52;
        \$('#mnegrid').jqGrid('setGridWidth',modalWidth);
        \$('#mnegrid').jqGrid('setGridHeight',modalHeight);
        \$('#mnegrid').fluidGrid({base:'#mne_dialog', offset:-25});
        });
//---------------------------------------------------------------
// END: Mnemonic Select Dialog
//---------------------------------------------------------------


});

\$(window).resize(function()
{
        \$('#mnegrid').fluidGrid({base:'#ui-dialog-title-mne_dialog', offset:-25});
});


CUSTOM;
$grid->setJSCode($custom);
$oper = jqGridUtils::GetParam("oper");
if ($oper == "pdf") {
    $grid->setPdfOptions(array("header" => true, "margin_top" => 25, "page_orientation" => "P", "header_logo" => "../../../../../images/Logo_450x123_24bit_color.jpg", "header_logo_width" => 45, "header_title" => "                         Mnemonics Report"));
}
// Enjoy
$summaryrows = array("Seen" => array("Seen" => "SUM"));
$grid->renderGrid('#mnegrid', '#mnepager', true, $summaryrows, null, true, true);
$conn = null;
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:31,代码来源:mne.php

示例6: array

$grid->setUrl('detail.php');
// Set some grid options
$grid->setGridOptions(array("rowNum" => 10, "footerrow" => true, "userDataOnFooter" => true, "sortname" => "OrderID", "height" => 110));
// Change some property of the field(s)
$grid->setColProperty("RequiredDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y"), "search" => false));
// on beforeshow form when add we get the customer id and set it for posting
$beforeshow = <<<BEFORE
function(formid)
{
var srow = jQuery("#grid").jqGrid('getGridParam','selrow');
if(srow) {
\tvar gridrow = jQuery("#grid").jqGrid('getRowData',srow);
\t\$("#CustomerID",formid).val(gridrow.CustomerID);
}
}
BEFORE;
// disable the CRUD buttons when we initialy load the grid
$initgrid = <<<INIT
jQuery("#add_detail").addClass("ui-state-disabled");
jQuery("#edit_detail").addClass("ui-state-disabled");
jQuery("#del_detail").addClass("ui-state-disabled");
INIT;
$grid->setJSCode($initgrid);
$grid->setColProperty("EmployeeID", array("hidden" => false, "width" => 20));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel" => true, "add" => true, "edit" => true, "del" => true, "view" => false));
$grid->setNavEvent('add', 'beforeShowForm', $beforeshow);
// Enjoy
$summaryrow = array("Freight" => array("Freight" => "SUM"));
$grid->renderGrid("#detail", "#pgdetail", true, $summaryrow, array((int) $rowid), true, true);
$conn = null;
开发者ID:nong053,项目名称:prototype-nnit,代码行数:31,代码来源:detail.php

示例7: array

{
        $('#hostsgrid').fluidGrid({base:'#ui-dialog-title-host_dialog', offset:-25});
});


CUSTOM;

$grid->setJSCode($custom);


$oper = jqGridUtils::GetParam("oper");
if($oper == "pdf") {
    $grid->setPdfOptions(array(
        "header"=>true,
        "margin_top"=>25,
        "page_orientation"=>"P",
		"header_logo"=>"../../../../../images/Logo_450x123_24bit_color.jpg",
        // set logo image width
        "header_logo_width"=>45,
        //header title
        "header_title"=>"                         Hosts Report"
    ));
} 

// Enjoy
# $summaryrows=array("Seen"=>array("Seen"=>"SUM")); 
$grid->renderGrid('#hostsgrid','#hostspager',true, null , array($securi), true,true);

$conn = null;
?>
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:30,代码来源:rbac-hosts.php

示例8: PDO

<?php

require_once '../../../jq-config.php';
//require_once ABSPATH."php/jqUtils.php";
require_once ABSPATH . "php/jqGrid.php";
//require_once ABSPATH."php/jqGridArray.php";
//require_once ABSPATH."php/jqGridPdo.php";
require_once ABSPATH . "php/jqChart.php";
ini_set("display_errors", "1");
// get your data manually and build the array
$myconn = new PDO(DB_DSN, DB_USER, DB_PASSWORD);
$myconn->query("SET NAMES utf8");
$sth = $myconn->prepare("SELECT CustomerID, SUM(Freight) AS Freight FROM orders WHERE  (CustomerID ='BERGS' OR  CustomerID ='WHITC' ) AND OrderDate BETWEEN '1997-01-01' AND '1997-12-31' GROUP BY CustomerID");
$sth->execute();
$customers = $sth->fetchAll(PDO::FETCH_ASSOC);
$chart = new jqChart();
$chart->setChartOptions(array("defaultSeriesType" => "bar"))->setTitle(array('text' => 'Freight  1997'))->setyAxis(array("title" => array("text" => "Freight")))->setJSCode("mychart = chart;")->setTooltip(array("formatter" => "function(){return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y;}"))->addSeries($customers[0]['CustomerID'], array($customers[0]['Freight']))->addSeries($customers[1]['CustomerID'], array($customers[1]['Freight']));
echo $chart->renderChart('', true, 700, 350);
// building the grid
$grid = new jqGridRender(null);
$grid->setColModel(array(array("name" => "CustomerID", "key" => true), array("name" => "Freight")));
$grid->setUrl('grid.php');
$grid->setGridOptions(array("datatype" => "local", "data" => $customers));
$grid->navigator = false;
$grid->renderGrid('#grid', '#pager', true, null, null, false, false);
// Enjoy
开发者ID:nong053,项目名称:prototype-nnit,代码行数:26,代码来源:chart.php

示例9: array

$choices = array("Yes" => "Yes", "No" => "No");
// $grid->setSelect("disabled", $choices , false, false, true, array(""=>"All"));
$grid->setSelect("disabled", $choices, false, true, true, array("" => "All"));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => false, "del" => false, "view" => false, "search" => true));
$grid->setNavOptions('edit', array("width" => "auto", "height" => "auto", "dataheight" => "auto", "top" => 200, "left" => 200));
$grid->setNavOptions('add', array("width" => "auto", "height" => "auto", "dataheight" => "auto", "top" => 200, "left" => 200));
$custom = <<<CUSTOM


        var modalWidth = \$("#portlet_Email_Alerts").width();
        var modalHeight = \$("#portlet_Email_Alerts").height() - 52;
        \$('#triggergrid').jqGrid('setGridWidth',modalWidth);
        \$('#triggergrid').jqGrid('setGridHeight',modalHeight);
        \$('#triggergrid').fluidGrid({base:'#portlet_Email_Alerts', offset:-25});

\$(window).resize(function()
{
        \$('#triggergrid').fluidGrid({base:'#portlet_Email_Alerts', offset:-25});
});


CUSTOM;
$grid->setJSCode($custom);
$oper = jqGridUtils::GetParam("oper");
if ($oper == "pdf") {
    $grid->setPdfOptions(array("header" => true, "margin_top" => 25, "page_orientation" => "P", "header_logo" => "../../../../../images/Logo_450x123_24bit_color.jpg", "header_logo_width" => 45, "header_title" => "                         Alerts Report"));
}
// Enjoy
$grid->renderGrid('#triggergrid', '#triggerpager', true, null, null, true, true);
$conn = null;
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:31,代码来源:email_alerts.php

示例10: array

$grid->setGridOptions(array("rowNum" => 18, "sortname" => "id", "sortorder" => "asc", "altRows" => true, "rowList" => array(20, 40, 60, 75, 100), "forceFit" => true));
$choices = array("search_history" => "Search History", "graph_history" => "Graph History");
$grid->setSelect("spanid", $choices, false, true, true, array("" => "All"));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("pdf" => true, "excel" => true, "add" => true, "edit" => false, "del" => false, "view" => false, "search" => true));
$grid->setNavOptions('edit', array("width" => "auto", "height" => "auto", "dataheight" => "auto", "top" => 200, "left" => 200));
$grid->setNavOptions('add', array("width" => "auto", "height" => "auto", "dataheight" => "auto", "top" => 200, "left" => 200));
$custom = <<<CUSTOM


        var modalWidth = \$("#portlet_Edit_Favorites").width();
        var modalHeight = \$("#portlet_Edit_Favorites").height() - 52;
        \$('#favorites_grid').jqGrid('setGridWidth',modalWidth);
        \$('#favorites_grid').jqGrid('setGridHeight',modalHeight);
        \$('#favorites_grid').fluidGrid({base:'#portlet_Edit_Favorites', offset:-25});

\$(window).resize(function()
        {
        \$('#favorites_grid').fluidGrid({base:'#portlet_Edit_Favorites', offset:-25});
        });


CUSTOM;
$grid->setJSCode($custom);
$oper = jqGridUtils::GetParam("oper");
if ($oper == "pdf") {
    $grid->setPdfOptions(array("header" => true, "margin_top" => 25, "page_orientation" => "P", "header_logo" => "../../../../../images/Logo_450x123_24bit_color.jpg", "header_logo_width" => 45, "header_title" => "                         Alerts Report"));
}
// Enjoy
$grid->renderGrid('#favorites_grid', '#favorites_pager', true, null, null, true, true);
$conn = null;
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:31,代码来源:favorites.php

示例11: jqGridArray

$orders = $sth->fetchAll(PDO::FETCH_ASSOC);
// end of custom code
if (count($orders) == 0) {
    return "[]";
}
// create the array connection
$conn = new jqGridArray();
if (!$subtable && !$rowid) {
    die("Missed parameters");
}
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = "SELECT * FROM orders";
// 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('subgrid.php');
// Set some grid options
$grid->setGridOptions(array("width" => 540, "rowNum" => 10, "sortname" => "OrderID", "height" => 110, "postData" => array("subgrid" => $subtable, "rowid" => $rowid)));
// Change some property of the field(s)
$grid->setColProperty("RequiredDate", array("formatter" => "date", "formatoptions" => array("srcformat" => "Y-m-d H:i:s", "newformat" => "m/d/Y"), "search" => false));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel" => false, "add" => false, "edit" => false, "del" => false, "view" => false));
// Enjoy
$subtable = $subtable . "_t";
$pager = $subtable . "_p";
$grid->renderGrid($subtable, $pager, true, null, null, true, true);
$conn = null;
开发者ID:nong053,项目名称:prototype-nnit,代码行数:31,代码来源:subgrid.php


注:本文中的jqGridRender::renderGrid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。