Announcement

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

    How to have a Listgrid boolean filter that only allows ticked and unticked values

    Please may I have a hint how to achieve the following?

    I have a Listgrid with a boolean field. By default the filter checkbox allows values of ticked, unticked and either (so that records with true or false values are returned). My requirement is to only allow the filter to be ticked and unticked, so the option to return either true or false is not available.
    Is this possible and if so how do I code it?
    Thanks.

    #2
    Use listGridField.setFieldEditorProperties() to set allowEmptyValue:false.

    Comment


      #3
      Belated thanks for the information.
      It showed I was on the right track, but what was stumping me was I was trying to change the grid after it had been drawn, and this was having no effect, which was a bit surprising as we'd previously successfully added formatting to grid fields after drawing the grid.
      In case it's of any use to someone reading this post, here's a code snippet of how I did it :
      Code:
      ListGridField accepted = new ListGridField("ACCEPTED");
      CheckboxItem cbi = new CheckboxItem();
      cbi.setAllowEmptyValue(false);
      accepted.setFilterEditorProperties(cbi);

      Comment


        #4
        Thanks a lot rodp. Worked for me!!!

        Comment

        Working...
        X