Announcement

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

    Listener on visible/non-visible columns

    Hi,

    I would like to apply a listener on visible/non-visible columns so that I can always have an updated list of visible fields of my ListGrid.
    The goal is to have an updated list of which columns are visible and non-visible. Then, on every action (make the column visible or non-visible) this list should become visible.

    I was wondering how to have this?

    version:
    com.smartgwt:smartgwt:5.1d-2015

    #2
    Hi maestass,

    did you see FieldStateChangedHandler?

    Best regards
    Blama

    Comment


      #3
      Hi Blama

      Thank you for your prompt answer.
      That helps a lot but could you please give me an example of how to use it in the context I described above? How can I check that every existing column is hidden or not ?
      ListGrid.addFieldStateChangedHandler(new FieldStateChangedHandler() { @Override public void onFieldStateChanged(FieldStateChangedEvent fieldStateChangedEvent) { //what to do here } });
      Last edited by maestass; 25 Nov 2020, 06:49.

      Comment


        #4
        There is Listgrid.getFieldState() which returns a JSON-like String (I think the docs say somewhere it's not real JSON). You can work with that String, extract visible/non-visible fields and compare that to getAllFields(). Perhaps in your case, working with that method and getFields() is even more easy.

        Comment

        Working...
        X