Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TreeGrid Filtering by Date clears out other Criteria from Filter Editor on filter

    I have a tree grid that display three columns: CC Name, CC Updated By , CC Updated Date

    When I filter using Name and Updated By all is fine and works well. The filter works and filter editor displays Name and Updated By for which filter was executed.

    If I use Updated Date (Date Item) along with Name and Updated By the filter works the first time but Name and Updated By values are cleared out from filter editor.

    I have no idea why filter editor criteria clears out, both name and updated by filter citeria show as spaces in filter editor. I think Treegrid not able to handle AdvancedCriteria and redraw the filter editor. If Simple Criteria is used like name and updated by it works

    1. Have the following datasource

    Code:
    <DataSource ID="ccdata" serverType="sql" tableName="ccdata">
    <fields>
    <field name="cc_id" type="sequence" sequenceName="s_ccdata" primaryKey="true" hidden="true" />
    <field name="cc_name" type="ntext" length="128"/>
    <field name="cc_parentid" sqlType="integer" type="integer" foreignKey="ccdata.cc_id"/>
    <field name="cc_updateby" type="ntext" length="256"/>
    <field name="cc_updatedate" sqlType="timestamp" type="datetime"/>
    <field name="isFolder" sqlType="integer" type="integer" canEdit="false" required="false" nillable ="true" canSave="false" customSelectExpression="(CASE WHEN ((SELECT count(*) FROM ccdata b WHERE b.cc_parentid = ccdata.cc_id) > 0) THEN 'true' ELSE 'false' END )"/>
    </fields>
    <operationBindings>
    <operationBinding operationType="fetch" requiresAuthentication="false" customValueFields="isFolder">
    <selectClause>
    ccdata.*,
    CASE WHEN ((SELECT count(*) FROM ccdata b WHERE b.cc_parentid = ccdata.cc_id) > 0)
    THEN 'true'
    ELSE 'false'
    END AS isFolder
    </selectClause>
    <tableClause>
    ccdata
    </tableClause>
    <whereClause>($defaultWhereClause)</whereClause>
    </operationBinding>
    </operationBindings>
    </DataSource>
    2. Have the following TreeGrid

    Code:
    import java.util.ArrayList;
    import java.util.List;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.Alignment;
    import com.smartgwt.client.types.FetchMode;
    import com.smartgwt.client.types.SelectionStyle;
    import com.smartgwt.client.types.TreeModelType;
    import com.smartgwt.client.widgets.tree.Tree;
    import com.smartgwt.client.widgets.tree.TreeGrid;
    import com.smartgwt.client.widgets.tree.TreeGridField;
    
    public class CCDataList extends TreeGrid {
    
    /**
    * Is Folder
    */
    private static final String ISFOLDER = "isFolder";
    
    /**
    * Default Constructor
    */
    public CCDataList() {
    
    super();
    
    this.setWidth100();
    this.setHeight100();
    this.setShowHeader( Boolean.TRUE );
    this.setAutoFitFieldWidths( Boolean.FALSE );
    this.setSelectionType( SelectionStyle.SINGLE );
    this.setCanEdit( Boolean.FALSE );
    this.setCanReparentNodes( Boolean.FALSE );
    this.setCanGroupBy( Boolean.FALSE );
    this.setCanFreezeFields( Boolean.FALSE );
    this.setCanPickFields( Boolean.FALSE );
    this.setCanMultiSort( Boolean.FALSE );
    this.setCanAutoFitFields( Boolean.FALSE );
    this.setDataFetchMode( FetchMode.PAGED );
    this.setCanHover( Boolean.TRUE );
    this.setShowHover( Boolean.TRUE );
    this.setShowHoverComponents( Boolean.TRUE );
    this.setShowRoot( Boolean.FALSE );
    this.setShowOpenIcons( Boolean.FALSE );
    this.setShowDropIcons( Boolean.FALSE );
    this.setClosedIconSuffix( "" );
    this.setNodeIcon( null );
    this.setLoadDataOnDemand( Boolean.TRUE );
    this.setAutoFetchData( Boolean.FALSE );
    this.setKeepParentsOnFilter( Boolean.FALSE );
    
    final Tree ccTree = new Tree();
    ccTree.setDefaultIsFolder( Boolean.FALSE );
    ccTree.setModelType( TreeModelType.PARENT );
    ccTree.setNameProperty( "cc_name" );
    ccTree.setIdField( "cc_id" );
    ccTree.setParentIdField( "cc_parentid" );
    ccTree.setReportCollisions( Boolean.FALSE );
    ccTree.setIsFolderProperty( ISFOLDER );
    ccTree.setRootValue( 0 );
    this.setDataProperties( ccTree );
    final DataSource ds = DataSource.get( "ccdata" );
    if ( ds == null ) {
    return;
    }
    this.setDataSource( ds );
    
    final List< TreeGridField > treeGridFieldList = new ArrayList<>();
    final TreeGridField ccName = new TreeGridField( "cc_name", "CC Name" );
    ccName.setTreeField( true );
    ccName.setHidden( Boolean.FALSE );
    ccName.setCanFilter( Boolean.TRUE );
    treeGridFieldList.add( ccName );
    
    final TreeGridField updatedBy = new TreeGridField( "cc_updateby", "Updated By" );
    updatedBy.setCellAlign( Alignment.LEFT );
    updatedBy.setHidden( Boolean.FALSE );
    updatedBy.setCanFilter( Boolean.TRUE );
    treeGridFieldList.add( updatedBy );
    
    final TreeGridField updatedDate = new TreeGridField( "cc_updatedate", "Updated Date" );
    updatedDate.setAlign( Alignment.LEFT );
    updatedDate.setCellAlign( Alignment.LEFT );
    updatedDate.setHidden( Boolean.FALSE );
    updatedDate.setCanFilter( Boolean.TRUE );
    treeGridFieldList.add( updatedDate );
    TreeGridField[] treeGridFields = new TreeGridField[treeGridFieldList.size()];
    treeGridFields = treeGridFieldList.toArray( treeGridFields );
    this.setFields( treeGridFields );
    }
    }

    3. Using SmartGWT Power Edition Build 5.1p-2016-08-06
    SGWT library to 5.1p - 2016-08-06
    Build fixes the bug for FF 48.0.
    http://forums.smartclient.com/forum/...ascript-errors

    4. Tested on FireFox ESR 24.3.0

    5. RPCRequest With Basic Name and Updated By Criteria
    Code:
    {
    dataSource:"ccdata",
    operationType:"fetch",
    componentId:"isc_CCDataList_0",
    data:{
    cc_name:"c1",
    cc_updateby:"admin",
    cc_parentid:0
    },
    startRow:0,
    endRow:75,
    sortBy:[
    "cc_name"
    ],
    textMatchStyle:"exact",
    resultTree:[ResultTree ID:isc_ResultTree_1 (dataSource: _ccdata, created by: isc_CCDataList_0)],
    callback:{
    caller:[ResultTree ID:isc_ResultTree_1 (dataSource: _ccdata, created by: isc_CCDataList_0)],
    methodName:"loadChildrenReply"
    },
    willHandleError:true,
    showPrompt:true,
    prompt:"Finding Records that match your criteria...",
    oldValues:{
    cc_parentid:0
    },
    requestId:"_ccdata$62741",
    internalClientContext:{
    parentNode:{
    cc_id:0,
    cc_name:"/",
    children:Array[0]
    },
    relationship:{
    childDS:[DataSource ID:_ccdata],
    parentDS:[DataSource ID:_ccdata],
    parentIdField:"cc_parentid",
    idField:"cc_id"
    },
    childrenReplyCallback:{
    },
    fetchCount:2
    },
    fallbackToEval:false,
    dataFetchMode:"paged",
    lastClientEventThreadCode:"TMR3",
    bypassCache:true,
    dataProtocol:"getParams"
    }
    6. RPCResponse With Basic Name and Updated By Criteria
    Code:
    {
    affectedRows:0,
    data:[
    {
    isFolder:"true",
    cc_name:"C1",
    cc_updatedate:"2016-10-06T18:05:48.000",
    cc_id:12,
    cc_updateby:"admin",
    cc_parentid:0,
    rowID:1
    }
    ],
    endRow:1,
    invalidateCache:false,
    isDSResponse:true,
    operationType:"fetch",
    queueStatus:0,
    startRow:0,
    status:0,
    totalRows:1
    }
    All good, the filter works and the filter editor shows the name and updated by criteria which was used for the filter

    7. RPCRequest With Name, Updated By and Updated Date Criteria
    Code:
    {
    dataSource:"ccdata",
    operationType:"fetch",
    componentId:"isc_CCDataList_0",
    data:{
    operator:"and",
    criteria:[
    {
    operator:"and",
    criteria:[
    {
    fieldName:"cc_name",
    operator:"iEquals",
    value:"c1"
    },
    {
    fieldName:"cc_updateby",
    operator:"iEquals",
    value:"admin"
    },
    {
    fieldName:"cc_updatedate",
    operator:"greaterOrEqual",
    value:"2016-10-05T04:00:00.000"
    }
    ]
    },
    {
    fieldName:"cc_parentid",
    value:0,
    operator:"equals"
    }
    ]
    },
    startRow:0,
    endRow:75,
    sortBy:[
    "cc_name"
    ],
    textMatchStyle:"substring",
    resultTree:[ResultTree ID:isc_ResultTree_1 (dataSource: ccdata, created by: isc_CCDataList_0)],
    callback:{
    caller:[ResultTree ID:isc_ResultTree_1 (dataSource: ccdata, created by: isc_CCDataList_0)],
    methodName:"loadChildrenReply"
    },
    willHandleError:true,
    showPrompt:true,
    prompt:"Finding Records that match your criteria...",
    oldValues:{
    operator:"and",
    criteria:[
    {
    operator:"and",
    criteria:[
    {
    fieldName:"cc_name",
    operator:"iEquals",
    value:"c1"
    },
    {
    fieldName:"cc_updateby",
    operator:"iEquals",
    value:"admin"
    },
    {
    fieldName:"cc_updatedate",
    operator:"greaterOrEqual",
    value:"2016-10-05T04:00:00.000"
    }
    ]
    },
    {
    fieldName:"cc_parentid",
    value:0,
    operator:"equals"
    }
    ]
    },
    requestId:"ccdata$62744",
    internalClientContext:{
    parentNode:{
    cc_id:0,
    cc_name:"/",
    children:Array[1],
    isFolder:true
    },
    relationship:{
    childDS:[DataSource ID:ccdata],
    parentDS:[DataSource ID:ccdata],
    parentIdField:"cc_parentid",
    idField:"cc_id"
    },
    childrenReplyCallback:{
    },
    fetchCount:5
    },
    fallbackToEval:false,
    dataFetchMode:"paged",
    lastClientEventThreadCode:"TMR6",
    bypassCache:true,
    dataProtocol:"getParams"
    }
    8. RPCResponse With Name, Updated By and Updated Date Criteria

    Code:
    {
    affectedRows:0,
    data:[
    {
    isFolder:"true",
    cc_name:"C1",
    cc_updatedate:"2016-10-06T18:05:48.000",
    cc_id:12,
    cc_updateby:"admin",
    cc_parentid:0,
    rowID:1
    }
    ],
    endRow:1,
    invalidateCache:false,
    isDSResponse:true,
    operationType:"fetch",
    queueStatus:0,
    startRow:0,
    status:0,
    totalRows:1
    }
    9. By this time - cc_name and cc_updateby values are cleared out from the filter editor criteria only the date remains in the filter editor.


    10. If I update cc_name and cc_updateby and try filtering again with Updated Date criteria still available, I see that the criteria in rpc request quickly build ups

    Code:
    {
    dataSource:"ccdata",
    operationType:"fetch",
    componentId:"isc_CCDataList_0",
    data:{
    operator:"and",
    criteria:[
    {
    operator:"and",
    criteria:[
    {
    fieldName:"cc_name",
    operator:"iEquals",
    value:"c1"
    },
    {
    fieldName:"cc_updateby",
    operator:"iEquals",
    value:"admin"
    },
    {
    fieldName:"cc_name",
    operator:"iEquals",
    value:"c2"
    },
    {
    fieldName:"cc_updateby",
    operator:"iEquals",
    value:"c2"
    },
    {
    fieldName:"cc_updatedate",
    operator:"greaterOrEqual",
    value:"2016-10-05T04:00:00.000"
    }
    ]
    },
    {
    fieldName:"cc_parentid",
    value:0,
    operator:"equals"
    }
    ]
    },
    startRow:0,
    endRow:75,
    sortBy:[
    "cc_name"
    ],
    textMatchStyle:"substring",
    resultTree:[ResultTree ID:isc_ResultTree_1 (dataSource: _ccdata, created by: isc_CCDataList_0)],
    callback:{
    caller:[ResultTree ID:isc_ResultTree_1 (dataSource: _ccdata, created by: isc_CCDataList_0)],
    methodName:"loadChildrenReply"
    },
    willHandleError:true,
    showPrompt:true,
    prompt:"Finding Records that match your criteria...",
    oldValues:{
    operator:"and",
    criteria:[
    {
    operator:"and",
    criteria:[
    {
    fieldName:"cc_name",
    operator:"iEquals",
    value:"c1"
    },
    {
    fieldName:"cc_updateby",
    operator:"iEquals",
    value:"admin"
    },
    {
    fieldName:"cc_name",
    operator:"iEquals",
    value:"c2"
    },
    {
    fieldName:"cc_updateby",
    operator:"iEquals",
    value:"c2"
    },
    {
    fieldName:"cc_updatedate",
    operator:"greaterOrEqual",
    value:"2016-10-05T04:00:00.000"
    }
    ]
    },
    {
    fieldName:"cc_parentid",
    value:0,
    operator:"equals"
    }
    ]
    },
    requestId:"_ccdata$62750",
    internalClientContext:{
    parentNode:{
    cc_id:0,
    cc_name:"/",
    children:Array[0]
    },
    relationship:{
    childDS:[DataSource ID:_ccdata],
    parentDS:[DataSource ID:_ccdata],
    parentIdField:"cc_parentid",
    idField:"cc_id"
    },
    childrenReplyCallback:{
    },
    fetchCount:11
    },
    fallbackToEval:false,
    dataFetchMode:"paged",
    lastClientEventThreadCode:"TMR5",
    bypassCache:true,
    dataProtocol:"getParams"

    Last edited by malcolm.pereira; 7 Oct 2016, 13:50.

    #2
    Be sure to use "code" tags around any source code or RPC request/response samples, or all indentation is lost and it becomes difficult to read.

    You seem to have provided a lot of details, but unless we missed it, you didn't include the most important thing: how are you applying criteria initially, and how are you changing the criteria subsequently? If the subsequent change to criteria is an end user action, please describe exactly what the end user is doing.

    Also, if your theory is that this is a framework bug and all it takes is to apply criteria then allow the end user to edit it in the filter editor, then please try reproducing this in a sample - should be easy to do, and means we will be able to reproduce it as well (if you succeed), as currently, your code would not be runnable for us.

    Comment


      #3
      Ok Sounds fair,

      I have created sample based on :http://www.smartclient.com/smartgwt/...e_multicolumns


      1. Entry Point Class

      Code:
      import com.google.gwt.core.client.EntryPoint;
      import com.google.gwt.i18n.client.NumberFormat;
      import com.smartgwt.client.widgets.grid.CellFormatter;
      import com.smartgwt.client.widgets.grid.ListGridRecord;
      import com.smartgwt.client.widgets.tree.TreeGrid;
      import com.smartgwt.client.widgets.tree.TreeGridField;
      
      public class MultipleColumnsSample implements EntryPoint {
      
          @Override
          public void onModuleLoad() {
      
              EmployeeXmlDS employeesDS = EmployeeXmlDS.getInstance();
      
              TreeGrid treeGrid = new TreeGrid();
              treeGrid.setCanEdit( true );
              treeGrid.setLoadDataOnDemand( false );
              treeGrid.setWidth( 500 );
              treeGrid.setHeight( 400 );
              treeGrid.setDataSource( employeesDS );
              treeGrid.setNodeIcon( "icons/16/person.png" );
              treeGrid.setFolderIcon( "icons/16/person.png" );
              treeGrid.setShowOpenIcons( false );
              treeGrid.setShowDropIcons( false );
              treeGrid.setClosedIconSuffix( "" );
              treeGrid.setAutoFetchData( true );
              treeGrid.setShowFilterEditor( true );
      
              TreeGridField nameField = new TreeGridField( "Name" );
              nameField.setCanFilter( true );
              TreeGridField jobField = new TreeGridField( "Job" );
              jobField.setCanFilter( true );
      
              TreeGridField salaryField = new TreeGridField( "Salary" );
              salaryField.setCanFilter( true );
              salaryField.setCellFormatter( new CellFormatter() {
      
                  @Override
                  public String format( Object value, ListGridRecord record, int rowNum, int colNum ) {
      
                      if ( value != null ) {
                          NumberFormat nf = NumberFormat.getFormat( "#,##0" );
                          try {
                              return "$" + nf.format( ( (Number)value ).longValue() );
                          } catch ( Exception e ) {
                              return value.toString();
                          }
                      } else {
                          return null;
                      }
                  }
              } );
              TreeGridField dateField = new TreeGridField( "Startdate" );
              dateField.setCanFilter( true );
              treeGrid.setFields( nameField, jobField, salaryField, dateField );
              treeGrid.draw();
          }
      }
      2. EmployeeXmlDS DataSource
      Code:
      
      import com.smartgwt.client.data.DataSource;
      import com.smartgwt.client.data.fields.DataSourceDateField;
      import com.smartgwt.client.data.fields.DataSourceFloatField;
      import com.smartgwt.client.data.fields.DataSourceIntegerField;
      import com.smartgwt.client.data.fields.DataSourceTextField;
      
      public class EmployeeXmlDS extends DataSource {
      
          private static EmployeeXmlDS instance = null;
      
          public static EmployeeXmlDS getInstance() {
      
              if ( instance == null ) {
                  instance = new EmployeeXmlDS( "employeesDS" );
              }
              return instance;
          }
      
          public EmployeeXmlDS( String id ) {
      
              setID( id );
              setTitleField( "Name" );
              setRecordXPath( "/List/employee" );
              DataSourceTextField nameField = new DataSourceTextField( "Name", "Name", 128 );
      
              DataSourceIntegerField employeeIdField = new DataSourceIntegerField( "EmployeeId", "Employee ID" );
              employeeIdField.setPrimaryKey( true );
              employeeIdField.setRequired( true );
      
              DataSourceIntegerField reportsToField = new DataSourceIntegerField( "ReportsTo", "Manager" );
              reportsToField.setRequired( true );
              reportsToField.setForeignKey( id + ".EmployeeId" );
              reportsToField.setRootValue( "1" );
      
              DataSourceTextField jobField = new DataSourceTextField( "Job", "Title", 128 );
              DataSourceTextField emailField = new DataSourceTextField( "Email", "Email", 128 );
              DataSourceTextField statusField = new DataSourceTextField( "EmployeeStatus", "Status", 40 );
              DataSourceFloatField salaryField = new DataSourceFloatField( "Salary", "Salary" );
              DataSourceTextField orgField = new DataSourceTextField( "OrgUnit", "Org Unit", 128 );
              DataSourceTextField genderField = new DataSourceTextField( "Gender", "Gender", 7 );
              genderField.setValueMap( "male", "female" );
              DataSourceTextField maritalStatusField = new DataSourceTextField( "MaritalStatus", "Marital Status", 10 );
              DataSourceDateField dateField = new DataSourceDateField( "Startdate", "Startdate", 10 );
              setFields( nameField, employeeIdField, reportsToField, jobField, dateField, emailField, statusField, salaryField, orgField, genderField, maritalStatusField );
      
              setDataURL( "ds/employees.data.xml" );
              setClientOnly( true );
          }
      }
      3. XML Data

      Code:
      <List>  
          <employee>  
              <EmployeeId>4</EmployeeId>  
              <ReportsTo>1</ReportsTo>  
              <Name>Charles Madigen</Name>  
              <Job>Chief Operating Officer</Job>  
              <Phone>x10962</Phone>  
              <Email>cmadigan@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>26200.00</Salary>  
              <Gender>male</Gender>  
              <MaritalStatus>married</MaritalStatus>  
              <EmployeeType>full time</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>
              <Startdate>2016-01-01</Startdate>    
          </employee>  
          <employee>  
              <EmployeeId>192</EmployeeId>  
              <ReportsTo>4</ReportsTo>  
              <Name>Ralph Brogan</Name>  
              <Job>Mgr Software Client Supp</Job>  
              <Phone>x32524</Phone>  
              <Email>rbrogan@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>13700.00</Salary>  
              <Gender>male</Gender>  
              <MaritalStatus>married</MaritalStatus>  
              <EmployeeType>full time</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>
              <Startdate>2016-01-02</Startdate>  
          </employee>  
          <employee>  
              <EmployeeId>295</EmployeeId>  
              <ReportsTo>192</ReportsTo>  
              <Name>Bhushan Sambhus</Name>  
              <Job>Line Worker</Job>  
              <Phone>x12125</Phone>  
              <Email>bsambhus@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>8300.00</Salary>  
              <Gender>female</Gender>  
              <MaritalStatus>married</MaritalStatus>  
              <EmployeeType>part time</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>  
                <Startdate>2016-01-03</Startdate>
          </employee>  
          <employee>  
              <EmployeeId>294</EmployeeId>  
              <ReportsTo>192</ReportsTo>  
              <Name>Betsy Rosenbaum</Name>  
              <Job>Met Read/Coll</Job>  
              <Phone>x22131</Phone>  
              <Email>brosenbaum@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>7450.00</Salary>  
              <Gender>female</Gender>  
              <MaritalStatus>married</MaritalStatus>  
              <EmployeeType>full time</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>  
                <Startdate>2016-01-04</Startdate>
          </employee>  
          <employee>  
              <EmployeeId>293</EmployeeId>  
              <ReportsTo>192</ReportsTo>  
              <Name>Francine Bergeron</Name>  
              <Job>Env Asst</Job>  
              <Phone>x03194</Phone>  
              <Email>fbergeron@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>5350.00</Salary>  
              <Gender>male</Gender>  
              <MaritalStatus>single</MaritalStatus>  
              <EmployeeType>contract</EmployeeType>  
                <EmployeeStatus>LOA</EmployeeStatus>  
                <Startdate>2016-01-05</Startdate>
          </employee>  
          <employee>  
              <EmployeeId>292</EmployeeId>  
              <ReportsTo>192</ReportsTo>  
              <Name>Amanda Jones</Name>  
              <Job>Line Wrker A</Job>  
              <Phone>x06056</Phone>  
              <Email>ajones@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>7050.00</Salary>  
              <Gender>female</Gender>  
              <MaritalStatus>single</MaritalStatus>  
              <EmployeeType>full time</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>  
                <Startdate>2016-01-06</Startdate>
          </employee>  
          <employee>  
              <EmployeeId>291</EmployeeId>  
              <ReportsTo>192</ReportsTo>  
              <Name>Fa Bai</Name>  
              <Job>Sr Engineer</Job>  
              <Phone>x03551</Phone>  
              <Email>fbai@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>8100.00</Salary>  
              <Gender>female</Gender>  
              <MaritalStatus>married</MaritalStatus>  
              <EmployeeType>contract</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>  
                <Startdate>2016-01-07</Startdate>
          </employee>  
          <employee>  
              <EmployeeId>290</EmployeeId>  
              <ReportsTo>192</ReportsTo>  
              <Name>Chase Godwin</Name>  
              <Job>Dsl Sys Rep</Job>  
              <Phone>x12823</Phone>  
              <Email>cgodwin@server.com</Email>  
              <OrgUnit>Management</OrgUnit>  
              <Salary>8900.00</Salary>  
              <Gender>male</Gender>  
              <MaritalStatus>married</MaritalStatus>  
              <EmployeeType>contract</EmployeeType>  
              <EmployeeStatus>active</EmployeeStatus>  
                <Startdate>2016-01-08</Startdate>
          </employee>  
      </List>
      2. First time the module is loaded I see the following 2 request/responses in smartGWTConsole. No Criteria is explicitly passed, just loading the default tree grid onmoduleload.

      First Request
      - URL: ds/employees.data.xml
      - Type: DSRequest
      - Operation: fetch
      - Component: isc_TreeGrid_0
      Code:
         RPCRequest:
         {
          "actionURL":"ds/employees.data.xml",
          "showPrompt":true,
          "transport":"xmlHttpRequest",
          "useSimpleHttp":true,
          "promptStyle":"cursor",
          "params":{
          },
          "httpMethod":"GET",
          "sendNoQueue":true,
          "bypassCache":true,
          "data":null
          }
      DSRequest:
      Code:
          {
          operationType:"fetch",
          componentId:"isc_TreeGrid_0",
          willHandleError:true,
          showPrompt:true,
          bypassCache:true,
          dataProtocol:"getParams"
          }
      Call Stack:
      Code:
          [c]RPCManager.sendRequest(_1=>Obj)
          [c]RPCManager.sendProxied(_1=>Obj, _2=>undef)
          [c]XMLTools.getXMLResponse(_1=>Obj)
          DataSource.sendDSRequest(_1=>Obj)
          DataSource.fetchingClientOnlyData(_1=>Obj)
          ** recursed on DataSource.sendDSRequest
      Raw Response is the XML data

      Second Request
      - URL: [client only]
      - Type: DSRequest
      - Operation: fetch<employeesDS_fetch>
      - Component: isc_TreeGrid_0

      RPCRequest:
      Code:
         {
          "actionURL":"ds/employees.data.xml",
          "showPrompt":true,
          "prompt":"Finding Records that match your criteria...",
          "transport":"xmlHttpRequest",
          "promptStyle":"cursor",
          "httpMethod":"POST",
          "bypassCache":true,
          "data":null
          }
      DSRequest:
      Code:
          {
          dataSource:"employeesDS",
          operationType:"fetch",
          componentId:"isc_TreeGrid_0",
          data:{
          },
          textMatchStyle:"exact",
          resultTree:[ResultTree ID:isc_ResultTree_0 (dataSource: employeesDS, created by: isc_TreeGrid_0)],
          callback:{
              caller:[ResultTree ID:isc_ResultTree_0 (dataSource: employeesDS, created by: isc_TreeGrid_0)],
              methodName:"loadChildrenReply"
          },
          willHandleError:true,
          showPrompt:true,
          prompt:"Finding Records that match your criteria...",
          requestId:"employeesDS$6270",
          internalClientContext:{
              parentNode:{
                  EmployeeId:"1",
                  children:Array[1],
                  isFolder:true
              },
              relationship:{
                  childDS:[DataSource ID:employeesDS],
                  parentDS:[DataSource ID:employeesDS],
                  parentIdField:"ReportsTo",
                  idField:"EmployeeId",
                  rootValue:"1"
              },
              childrenReplyCallback:{
              },
              fetchCount:1
          },
          fallbackToEval:false,
          progressiveLoading:false,
          bypassCache:true,
          clientOnly:true,
          dataProtocol:"clientOnly"
          }
      Call Stack:
      Code:
          [c]RPCManager.sendRequest(_1=>Obj)
          DataSource.sendDSRequest(_1=>Obj)
          DataSource.processDeferredRequests()
          $376(_14=>Obj, _15=>Array[8], Obj)
          [c]Class.fireCallback(_1=>$376(), _2=>"dsResponse,data,dsRequest", _3=>Array[3], _4=>[DataSource ID:employeesDS$499], _5=>undef)
          Class.fireCallback(_1=>$376(), _2=>"dsResponse,data,dsRequest", _3=>Array[3], _4=>undef)
          DataSource.fireResponseCallbacks(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Obj)
          DataSource.$38b(_1=>[XMLDoc <List>], _2=>Obj, _3=>Obj, _4=>Obj, _5=>Obj)
          DataSource.$57b(_1=>Obj, _2=>Obj)
          ** recursed on [c]Class.fireCallback
      Raw Response is the all XML data

      At this point my tree grid with employee data is loaded.

      3. I enter the folowing filter criteria and click the filter icon/button
      Name: c
      Title: ds
      Start Date: 01/08/2016

      No search results returned, Name and Title cleared out from filter editor. Date entered is still available in the filter criteria the other two are cleard off.

      I see the following request/responses in smartGWTConsole
      - URL: [client only]
      - Type: DSRequest
      - DS: employeeDS
      - Operation: fetch<employeesDS_fetch>
      - Component: isc_TreeGrid_0

      RCP Request:
      Code:
         {
          "actionURL":"ds/employees.data.xml",
          "showPrompt":true,
          "prompt":"Finding Records that match your criteria...",
          "transport":"xmlHttpRequest",
          "promptStyle":"cursor",
          "httpMethod":"POST",
          "bypassCache":true,
          "data":null
          }
      DSRequest:
      Code:
          {
          dataSource:"employeesDS",
          operationType:"fetch",
          componentId:"isc_TreeGrid_0",
          data:{
              operator:"and",
              criteria:[
                  {
                      fieldName:"Name",
                      operator:"iEquals",
                      value:"c"
                  },
                  {
                      fieldName:"Job",
                      operator:"iEquals",
                      value:"ds"
                  },
                  {
                      fieldName:"Startdate",
                      operator:"greaterOrEqual",
                      value:"2016-01-08"
                  }
              ]
          },
          textMatchStyle:"substring",
          resultTree:[ResultTree ID:isc_ResultTree_0 (dataSource: employeesDS, created by: isc_TreeGrid_0)],
          callback:{
              caller:[ResultTree ID:isc_ResultTree_0 (dataSource: employeesDS, created by: isc_TreeGrid_0)],
              methodName:"loadChildrenReply"
          },
          willHandleError:true,
          showPrompt:true,
          prompt:"Finding Records that match your criteria...",
          requestId:"employeesDS$6271",
          internalClientContext:{
              parentNode:{
                  EmployeeId:"1",
                  children:Array[0]
              },
              relationship:{
                  childDS:[DataSource ID:employeesDS],
                  parentDS:[DataSource ID:employeesDS],
                  parentIdField:"ReportsTo",
                  idField:"EmployeeId",
                  rootValue:"1"
              },
              childrenReplyCallback:{
              },
              fetchCount:2
          },
          fallbackToEval:false,
          progressiveLoading:false,
          lastClientEventThreadCode:"TMR8",
          bypassCache:true,
          clientOnly:true,
          dataProtocol:"clientOnly"
          }
      Call Stack:
      Code:
          [c]RPCManager.sendRequest(_1=>Obj)
          DataSource.sendDSRequest(_1=>Obj)
          DataSource.performDSOperation(_1=>"fetch", _2=>Obj{_constructor:AdvancedCriteria}, _3=>Obj, _4=>Obj)
          DataSource.fetchData(_1=>Obj{_constructor:AdvancedCriteria}, _2=>Obj, _3=>Obj)
          ResultTree.$121b(_1=>Obj, _2=>null, _3=>null, _4=>undef)
          Tree.loadChildren(_1=>Obj, _2=>undef)
          Tree.reloadChildren(_1=>Obj, _2=>undef)
          ResultTree.invalidateCache()
          ResultTree.setCriteria(_1=>Obj{_constructor:AdvancedCriteria})
          Canvas.updateDataModel(_1=>Obj{_constructor:AdvancedCriteria}, _2=>Obj{ID:employeesDS_fetch}, _3=>Obj)
          Canvas.filterWithCriteria(_1=>Obj{_constructor:AdvancedCriteria}, _2=>Obj{ID:employeesDS_fetch}, _3=>Obj)
          Class.invokeSuper(_1=>null, _2=>"filterWithCriteria", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef, _11=>undef, _12=>undef, _13=>undef)
          Class.Super(_1=>"filterWithCriteria", _2=>[object Arguments], _3=>undef)
          TreeGrid.filterWithCriteria(_1=>Obj{_constructor:AdvancedCriteria}, _2=>Obj{ID:employeesDS_fetch}, _3=>Obj)
          Canvas.$wo(_1=>"filter", _2=>Obj{_constructor:AdvancedCriteria}, _3=>undef, _4=>Obj)
          ** recursed on Class.invokeSuper
      Raw Response is just [] (empty)

      4. Now I cannot return back to original results, not matter what even if I clean out date and try to filter, orginal results are never displayed. I need to reload/refresh entire page
      Last edited by malcolm.pereira; 7 Oct 2016, 15:34.

      Comment


        #4
        We see the problem and we'll update here in a day or two when it's been fixed.

        You can fix it in the meantime by specifying the default operator to use for your fields:

        Code:
        nameField.setFilterOperator(OperatorId.ICONTAINS);
        ...
        jobField.setFilterOperator(OperatorId.ICONTAINS);
        Last edited by Isomorphic; 7 Oct 2016, 21:37.

        Comment


          #5
          Using contains operator helped.

          Thank you for your time.

          Comment

          Working...
          X