Announcement

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

    remove addEditorExitHandler called on FIlteEditor row

    Hi,

    I am using addEditorExitHandler on a ListGridField.

    field.addEditorExitHandler(event -> {
    event.getGrid().setEditValue(event.getRowNum(), "fieldName", "Value");
    });

    I do not want this code to be called for the filter editor. I tried adding a condition, that if event.getRowNum()!=0 , perform above step. But then in this case when i add a new row using startEditingNew() and if its rownum is also 0, this code does not execute.
    Is there anyway i can differentiate if the handler is called from filter editor or grid row.

    #2
    Hi,

    why not create a subclass of it, one with handler, one without?

    Best regards
    Blama

    Comment


      #3
      Thanks Blama.
      I need the action to be performed on EditorExitHandler both while update and adding a new row. But it should not be called on the filter edtior. I get event.getRecord() as not null on update operation and event.getRownum() is not null during add operation. But the rownum is 0 for both the first row added and the filterEditor row. How can i create a subclass with different handlers in this case.

      Comment


        #4
        Hi,

        you can set different editor with setEditorProperties and the filterEditor with setFilterEditorProperties(). Does this already help?
        Otherwise you could perhaps get the source (editor vs filterEditor) from available EditorExitEvent getters, but I'm not sure.

        Nevertheless I agree that I would not expect the handler to fire for the filterRow-editor at all.

        Best regards
        Blama

        Comment


          #5
          Thank you once again Blama. But with setEditorProperies, we are adding an editor. Here i am just trying to add some operation on editorExitHandler which is bound to the ListgridField. Hence, i am unable to use the first option.
          Also, i tried the second option, but in both the cases i get the source as ListGridField

          Comment


            #6
            The best thing to do is show the source code that sets this grid up, so we can see the full picture.

            You could probably do what you want by checking that event.getGrid().getID() is what you expect it to be (the filterEditor is a separate grid, with a different ID than the parent grid) - but if there's a bug here, we'd like to fix it, so a test-case that show the issue is the best way forward.

            Comment


              #7
              Blama Isomorphic Thanks a lot. I used the event.getGrid().getID() to differentiate between the two events and it worked.

              Comment

              Working...
              X