当前位置: 首页>>代码示例>>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;未经允许,请勿转载。