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}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术