Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 02:27:24 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Hidden Colums and Filter doensn't work together  (Read 703 times)
Jürg
Jr. Member
**
Posts: 6


View Profile
« on: June 29, 2010, 01:33:45 AM »

Hi,

We are using sigma grid in one of our Intranet Sites and we are licensed users of it. We are facing one issue related with hidden columns - CustomHead filtering and need help on it.

In the Custom head, there are input fileds to filter the data with action doFilter(),
But if there are some columns hidden, the Filter doesn't work correctly.
If one column is hidden and i input the filter data in the next column header the filter is correct.
So what are we doing wrong?

Thanks for help.

Below the code of the page.



<script type="text/javascript" >

var table_id = "mySorttable" ;
var dsOption =
   {   fields:
      [
         {name: 'uid' },
           {name: 'name' },
           {name: 'company' },
           {name: 'department' },
         {name: 'mailAddress' },
         {name: 'mobilePhoneNumber' },
         {name: 'useSMSService' },
         {name: 'useMailService' },
         {name: 'isActive' },
         {name: 'isAllowedToExport' },
         {name: 'validSince' , type:'date' },
         {name: 'lastLogin' , type:'date' },
         {name: 'groupName' },
         {name: 'userContracts' },
         {name: 'userModalities' },
         {name: 'userRegions' },
         {name: 'suppressedRegions' },
      ],
      recordType : 'object'
   };

var colsOption =
   [
      {id: 'uid',             header: 'ID',               width: 70, renderer:my_url_renderer },
      {id: 'name',             header: 'Name',               width: 180 },
     {id: 'company',         header: 'Company',            width: 90, hidden: true },
      {id: 'department',      header: 'Department',         width: 90 },
     {id: 'mailAddress',      header: 'Mail',               width: 180 },
     {id: 'mobilePhoneNumber',   header: 'Mobile',            width: 80 },
     {id: 'useSMSService',      header: 'RoomDown SMS',         width: 55, align: 'center', renderer:my_img_renderer },
     {id: 'useMailService',   header: 'RoomDown Mail',      width: 55, align: 'center', renderer:my_img_renderer },
     {id: 'isActive',         header: 'Enabled',            width: 55, align: 'center', renderer:my_img_renderer },
     {id: 'isAllowedToExport',   header: 'can Export',         width: 55, align: 'center', renderer:my_img_renderer },
     {id: 'validSince',      header: 'Valid Since',         width: 120 },
     {id: 'lastLogin',         header: 'Last Login',         width: 120 },
     {id: 'groupName',         header: 'Group',            width: 80  },
     {id: 'userContracts',      header: 'Contract Types',      width: 120 },
     {id: 'userModalities',   header: 'Modalities',         width: 120 },
      {id: 'userRegions',      header: 'Regions',            width: 120 },
     {id: 'suppressedRegions',   header: 'Suppressed Regions',   width: 120 }    
   ];

var gridOption=
   {   id : "mySorttable",
      width: "100%", 
      height: "512", 
      container : 'gridbox',
      replaceContainer : true,
      encoding : 'UTF-8',
      customHead : 'myHead',
      loadURL : "./include/pages/CSWeb_GetUsers.php",
      exportURL :   './include/pages/CSWeb_ExportGrid.php?export=true&data=Users',
      exportFileName : 'CSWebExport',
      dataset : dsOption,
      columns : colsOption,
      toolbarPosition : 'top',
      showGridMenu : true,
      allowHide   : true ,
<?php
if($currentUser->getIsAllowedToExport() == 1 )   
   {   echo   "toolbarContent : 'nav | goto | reload | csv state',"; }
else
   {   echo   "toolbarContent : 'nav | goto | reload | state',"; }
?>      
      pageSize : 20,
      remotePaging : false,
      remoteSort : false
   };

var sortTable=new Sigma.Grid( gridOption );

function my_url_renderer(value ,record,columnObj,grid,colNo,rowNo){
   return "<a href=CSWeb_EditUserSettings.php?task=edit&amp;id=" + value + ">" + value + "</a>";
};

function my_img_renderer(value ,record,columnObj,grid,colNo,rowNo){
   return "<img src=\"./images/tick_" + value + ".png\" >";
};

function doFilter() {
    var filterInfo=[
    {
        fieldName : "uid",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_uid")
    },
    {
        fieldName : "name",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_name")
    },
    {
        fieldName : "company",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_company")
    },
    {
        fieldName : "department",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_department")
    },
    {
        fieldName : "mailAddress",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_mailAddress")
    },
    {
        fieldName : "mobilePhoneNumber",
        logic : "like",
        value : Sigma.Util.getValue("f_mobilePhoneNumber")
    },
    {
        fieldName : "useSMSService",
        logic : "like",
        value : Sigma.Util.getValue("f_useSMSService")
    },
    {
        fieldName : "useMailService",
        logic : "like",
        value : Sigma.Util.getValue("f_useMailService")
    },
    {
        fieldName : "isActive",
        logic : "like",
        value : Sigma.Util.getValue("f_isActive")
    },
    {
        fieldName : "isAllowedToExport",
        logic : "like",
        value : Sigma.Util.getValue("f_isAllowedToExport")
    },
    {
        fieldName : "validSince",
        logic : "like",
        value : Sigma.Util.getValue("f_validSince")
    },
    {
        fieldName : "lastLogin",
        logic : "like",
        value : Sigma.Util.getValue("f_lastLogin")
    },
    {
        fieldName : "groupName",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_groupName")
    },
    {
        fieldName : "userContracts",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_userContracts")
    },
    {
        fieldName : "userModalities",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_userModalities")
    },
    {
        fieldName : "userRegions",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_userRegions")
    },
    {
        fieldName : "suppressedRegions",
        logic : "likeNotCase",
        value : Sigma.Util.getValue("f_suppressedRegions")
    }
   ]
    var grid=Sigma.$grid("mySorttable");
    var rowNOs=grid.filterGrid(filterInfo);
}

Sigma.Util.onLoad( Sigma.Grid.render(sortTable) );


</script>

<!-- Content starts -->
<DIV class=content_wide>
<h5>User Management</h5>

<table id="myHead" style="display:none">
<tr>
   <td columnId='uid'>ID</td>
   <td columnId='name'>Name</td>
   <td columnId='company'>Company</td>
   <td columnId='department'>Department</td>
   <td columnId='mailAddress'>Mail</td>
   <td columnId='mobilePhoneNumber'>Mobile</td>   
   <td columnId='useSMSService'>SMS</td>
   <td columnId='useMailService'>Mail</td>
   <td columnId='isActive'>Enabled</td>
   <td columnId='isAllowedToExport'>Export</td>
   <td columnId='validSince'>Valid Since</td>
   <td columnId='lastLogin'>Last Login</td>
   <td columnId='groupName'>Group</td>
   <td columnId='userContracts'>Contract Types</td>
   <td columnId='userModalities'>Modalities</td>
   <td columnId='userRegions'>Regions</td>
   <td columnId='suppressedRegions'>Suppressed Regions</td>
</tr>
<tr>
   <td><input class="gt-editor-text" type="text" id="f_uid" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_name" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_company" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_department" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_mailAddress" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_mobilePhoneNumber" value="" onKeyUp="doFilter()"></td>   
   <td><input class="gt-editor-text" type="text" id="f_useSMSService" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_useMailService" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_isActive" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_isAllowedToExport" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_validSince" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_lastLogin" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_groupName" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_userContracts" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_userModalities" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_userRegions" value="" onKeyUp="doFilter()"></td>
   <td><input class="gt-editor-text" type="text" id="f_suppressedRegions" value="" onKeyUp="doFilter()"></td>
</tr>
</table>


<div id="gridbox" > </DIV>
</DIV>




Logged
Matthe55
Newbie
*
Posts: 3


View Profile
« Reply #1 on: August 20, 2010, 11:47:02 PM »

How to Swing Golf Irons

I like Tiger Woods, and hope he could keep his felling to keep No.1. Play that ball midway between the front feet coupled with ping rapture v2 irons when playing from the short grass in the fairway. ishiner
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!