當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jqgrid::set_conditional_css方法代碼示例

本文整理匯總了PHP中jqgrid::set_conditional_css方法的典型用法代碼示例。如果您正苦於以下問題:PHP jqgrid::set_conditional_css方法的具體用法?PHP jqgrid::set_conditional_css怎麽用?PHP jqgrid::set_conditional_css使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jqgrid的用法示例。


在下文中一共展示了jqgrid::set_conditional_css方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

$f["op"] = "cn";
$f["value"] = "01";
$f["css"] = "'background-color':'lightgreen'";
$f_conditions[] = $f;
$f = array();
$f["column"] = "id";
$f["op"] = ">";
$f["value"] = "20";
$f["css"] = "'background-color':'pink'";
$f_conditions[] = $f;
// if nothing set in 'op' and 'value', it will set column formatting for all cell
$f = array();
$f["column"] = "invdate";
$f["css"] = "'background-color':'#FBEC88', 'border-color': 'black', 'color':'black'";
$f_conditions[] = $f;
$g->set_conditional_css($f_conditions);
$g->set_actions(array("add" => false, "edit" => true, "delete" => true, "rowactions" => true, "export" => true, "autofilter" => true, "search" => "advance"));
// you can provide custom SQL query to display data
$g->select_command = "SELECT i.id, invdate , c.name FROM invheader i\n\t\t\t\t\t\tINNER JOIN clients c ON c.client_id = i.client_id";
// this db table will be used for add,edit,delete
$g->table = "invheader";
// pass the cooked columns to grid
$g->set_columns($cols);
// generate grid output, with unique grid name as 'list1'
$out = $g->render("list1");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
	<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/redmond/jquery-ui.custom.css"></link>	
	<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>	
開發者ID:ra-ckhar,項目名稱:www,代碼行數:31,代碼來源:conditional-format.php

示例2: add_invoice

$f_conditions[] = $f;
$f = array();
$f["column"] = "managerRating";
$f["op"] = "=";
$f["value"] = "0";
// you can use placeholder of column name as value
$f["cellcss"] = "'background-color':'#fcfdfd'";
$f_conditions[] = $f;
$f = array();
$f["column"] = "awarded";
$f["op"] = ">";
$f["value"] = "0";
// you can use placeholder of column name as value
$f["cellcss"] = "'background-color':'#a0e1a7'";
$f_conditions[] = $f;
$grid->set_conditional_css($f_conditions);
$out_master = $grid->render("list1");
// callback for add
function add_invoice($data)
{
    $upload_file_path = $data["params"]["note"];
    // if file is uploaded
    if ($upload_file_path) {
        // your custom upload code goes here e.g. File DB insertion
        $f = pathinfo(realpath($upload_file_path));
        $ext = pathinfo(realpath($upload_file_path), PATHINFO_EXTENSION);
        if ($ext != "pdf" && $ext != "gif" && $ext != "jpg" && $ext != "txt" && $ext != "doc" && $ext != "bmp" && $ext != "png") {
            unlink(realpath($upload_file_path));
            phpgrid_error("Only pdf, gif, jpg, txt, doc, bmp, png files are allowed!");
        }
        // rename file OR place folder
開發者ID:e-stonia,項目名稱:cn,代碼行數:31,代碼來源:master-detail.php


注:本文中的jqgrid::set_conditional_css方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。