Announcement

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

    TreeGrid Hilites are not applied to child records

    When TreeGrid.setLoadDataOnDemand is set to false, Hilite elements are not applied to child records. Set it to true, and all is fine.

    Having found an issue with my TreeGrid code, I stripped down what I was trying to do and implemented it with your sample showcase code. You'll notice the extra Hilite code at the bottom.

    Version: SmartGWT 2.5 Pro
    Browser: FireFox 3.6

    EmployeeXmlDS employeesDS = EmployeeXmlDS.getInstance();

    final TreeGrid treeGrid = new TreeGrid();

    //Set this to TRUE and hilites work for all records
    //Set it to FALSE and hilites work for root records only.
    treeGrid.setLoadDataOnDemand(false);
    treeGrid.setWidth100();
    treeGrid.setHeight100();
    treeGrid.setDataSource(employeesDS);
    treeGrid.setCanEdit(true);
    treeGrid.setNodeIcon("icons/16/person.png");
    treeGrid.setFolderIcon("icons/16/person.png");
    treeGrid.setAutoFetchData(true);
    treeGrid.setCanFreezeFields(true);
    treeGrid.setCanReparentNodes(true);

    TreeGridField nameField = new TreeGridField("Name", 150);
    nameField.setFrozen(true);

    TreeGridField jobField = new TreeGridField("Job", 150);
    TreeGridField employeeTypeField = new TreeGridField("EmployeeType", 150);
    TreeGridField employeeStatusField = new TreeGridField("EmployeeStatus", 150);
    TreeGridField salaryField = new TreeGridField("Salary");
    TreeGridField genderField = new TreeGridField("Gender");
    TreeGridField maritalStatusField = new TreeGridField("MaritalStatus");

    treeGrid.setFields(nameField, jobField, employeeTypeField, employeeStatusField,
    salaryField, genderField, maritalStatusField);

    Hilite h = new Hilite();
    h.setFieldName("Gender");
    Criterion c = new Criterion("Gender", OperatorId.EQUALS, "male");
    h.setBackgroundColor("blue");
    h.setCriteria(c);

    Hilite[] harray = new Hilite[1];
    harray[0] = h;
    treeGrid.setHilites(harray);

    treeGrid.draw();

    The attached treegrid.png shows the result (when opening a parent node).

    Is there something I have to do to allow hilites to apply to ALL records?

    Thanks!
    Attached Files

    #2
    Verified. This will be fixed in the next nightly build (Feb 17 or greater) on the 3.0p and 3.1d branches.

    Comment


      #3
      SmartGWT 3.0 Power
      SmartClient Version: SC_SNAPSHOT-2012-02-17_v8.2p/PowerEdition Deployment (built 2012-02-17)
      Firefox 3.6.26
      Chrome 17.0.963.56

      After switching to this build, we now get the following errors when we try to open a closed tree branch. Little vague I know but I haven't had a chance yet to dive into the problem. I am adding to this post because we see the same TreeGrid hilite behavior that kjmoroney describes. I could eventually open a new thread and post a test case if needed, but it won't be in the immediate future.
      Cheers

      Code:
      13:34:13.068 [ERROR] [emdwh] 13:34:13.073:MUP1:WARN:Log:ReferenceError: node is not defined
          anonymous({Obj}, true, undef) @ emdwh/sc/modules/ISC_Core.js:67
          Tree.openFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:193
          ListGrid.openFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:1264
          ListGrid.toggleFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:1262
          TreeGridBody.click(event=>{Obj}, eventInfo=>undef) @ emdwh/sc/modules/ISC_Grids.js:3128
          Canvas.handleClick(_1=>{Obj},  _2=>undef) @ emdwh/sc/modules/ISC_Core.js:3243
          [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click") @ emdwh/sc/modules/ISC_Core.js:1666
          [c]EventHandler.handleClick(_1=>{Obj}) @ emdwh/sc/modules/ISC_Core.js:1504
          EventHandler._handleMouseUp([object MouseEvent], undef) @ emdwh/sc/modules/ISC_Core.js:1491
          [c]EventHandler.handleMouseUp(_1=>[object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:1482
          [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:1729
          anonymous([object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:61
          unnamed() @ 
      
      
      com.smartgwt.client.core.JsObject$SGWT_WARN: 13:34:13.073:MUP1:WARN:Log:ReferenceError: node is not defined
          anonymous({Obj}, true, undef) @ emdwh/sc/modules/ISC_Core.js:67
          Tree.openFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:193
          ListGrid.openFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:1264
          ListGrid.toggleFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:1262
          TreeGridBody.click(event=>{Obj}, eventInfo=>undef) @ emdwh/sc/modules/ISC_Grids.js:3128
          Canvas.handleClick(_1=>{Obj},  _2=>undef) @ emdwh/sc/modules/ISC_Core.js:3243
          [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click") @ emdwh/sc/modules/ISC_Core.js:1666
          [c]EventHandler.handleClick(_1=>{Obj}) @ emdwh/sc/modules/ISC_Core.js:1504
          EventHandler._handleMouseUp([object MouseEvent], undef) @ emdwh/sc/modules/ISC_Core.js:1491
          [c]EventHandler.handleMouseUp(_1=>[object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:1482
          [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:1729
          anonymous([object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:61
          unnamed() @ 
      
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
          at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
          at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Thread.java:662)
      Last edited by lextra; 18 Feb 2012, 04:44.

      Comment


        #4
        This was an overnight regression affecting just that build - an unintended consequence of the fix. Please grab the next nightly.

        Comment


          #5
          SGWT 3.0 Power/SmartClient Version: SC_SNAPSHOT-2012-02-20_v8.2p/PowerEdition Deployment
          (built 2012-02-20)
          Firefox 3.6, 6.0.2
          Chrome

          Sorry - we see the same problem with latest build.
          Cheers

          Code:
          15:21:58.080:MUP2:WARN:Log:ReferenceError: node is not defined
              anonymous({Obj}, true, undef) @ emdwh/sc/modules/ISC_Core.js:67
              Tree.openFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:193
              ListGrid.openFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:1264
              ListGrid.toggleFolder(_1=>{Obj}) @ emdwh/sc/modules/ISC_Grids.js:1262
              TreeGridBody.click(event=>{Obj}, eventInfo=>undef) @ emdwh/sc/modules/ISC_Grids.js:3128
              Canvas.handleClick(_1=>{Obj},  _2=>undef) @ emdwh/sc/modules/ISC_Core.js:3244
              [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click") @ emdwh/sc/modules/ISC_Core.js:1667
              [c]EventHandler.handleClick(_1=>{Obj}) @ emdwh/sc/modules/ISC_Core.js:1505
              EventHandler._handleMouseUp([object MouseEvent], undef) @ emdwh/sc/modules/ISC_Core.js:1492
              [c]EventHandler.handleMouseUp(_1=>[object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:1483
              [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:1730
              anonymous([object MouseEvent]) @ emdwh/sc/modules/ISC_Core.js:61
              unnamed() @ :0
              unnamed() @

          Comment


            #6
            Ok - we see the problem. This will be resolved in the next nightly (Feb 21 or greater)

            Comment


              #7
              Thank you! Latest 3.0 nightly seems to work perfectly. Also seems to include a big performance boost ... since the jan 30th nightly.

              Comment

              Working...
              X