dosin84644 2014-11-26 07:25
浏览 173
已采纳

如何通过默认隐藏Flexgrid中的特定列

Please help, I want to hide a particular coloumn in flexigrid by default

Here is my Flexigrid which is sent in json

   $total = $this->countRec('id','pipo_orders',$where);
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
    header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
    header("Cache-Control: no-cache, must-revalidate" );
    header("Pragma: no-cache" );
    header("Content-type: text/x-json");
    $json = "";
    $json .= "{
";
    $json .= "page: $page,
";
    $json .= "total: $total,
";
    $json .= "rows: [";
    $rc = false;
    $i=1;
    //while ($row = mysql_fetch_array($result)) {
    foreach($result as $row) {
    $json .= "<input id=\"demo_box_".$i."\" class=\"css-checkbox csscheck\" type=\"checkbox\" value=\"".trim($row->id)."\"  /><label for=\"demo_box_".$i."\" name=\"demo_lbl_".$i."\" class=\"css-label\"></label>','";

Here is the json of the checkbox

$json .= "<input id=\"demo_box_".$i."\" class=\"css-checkbox csscheck\" type=\"checkbox\" value=\"".trim($row->id)."\"  /><label for=\"demo_box_".$i."\" name=\"demo_lbl_".$i."\" class=\"css-label\"></label>','";

I want to uncheck the first checkbox by default so that my first coloumn should always be hidden whenever the flexloads,

enter image description here

How can i do this or is there any other way to hide the first coloumn which has checkbox to be hidden by default. Please help

Note : I don't want to hardcode in side the checkbox element as checked but i want to do it in the flexigrid way so that the entire coloumn itself disappear.

  • 写回答

1条回答 默认 最新

  • dsbqfrr098575666 2014-12-24 20:40
    关注

    What ever the coloumn it might be hide: true will do the trick.

    In your FlexiGrid code to display the coloumn (Probably in your view)

    {display: 'ID', name : 'id', width : 50, sortable : true, align: 'left', hide: true}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备