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

    ListGrid editor having filter

    I have created a editor for listgrid using below code:

    SmartClient Version: v11.0p_2017-02-11/PowerEdition Deployment (built 2017-02-11)

    DataSource hardwareTypeDS = DataSource.get("hdwDS");
    SelectItem selectItem = new SelectItem();
    ListGridField typeField = new ListGridField("type");
    ListGridField productDescField = new ListGridField("desc");
    selectItem.setPickListFields(typeField, productDescField);

    Now i want the editor to have a filter bar above like we have in listgrids by setiing setShowFilterEditor. How can this be achieved?
    Last edited by swatiagarwal; 23 May 2017, 22:42.

    Use SelectItem.setPickListProperties().


      Thanks Michalg. But how to pass the show filter option to true in setPickListProperies() function?


        Got it. Thanks a lot.
        ListGrid userSelectProperties = new ListGrid();
        selectItem.setPickListProperies(userSelectProperties );


          The select item has multiselect on. I need a filter on the checkbox as well, so that i can filter out the selected items. Any help?


            Could you show your current code and explain your goal based on a screenshot with comments?
            Also please show the code for the ListGridField and the .ds.xml-field.
            At least for me it is completely unclear what you are looking for.

            Best regards


              In the screenshot, i have highlighted in red in filter bar. I want a checkbox filter to appear there which filters out all the checked values. Since, i am setting only three properties as picklist fields, the checkbox filter is not visible.
              Attached Files


                Basically the same as in this sample (middle), if you select some entries? If it marked the already selected entries, you would not need your functionality, right?
                Does this already work and is just not shown because you did not select anything? What does the screenshot look like for an entry where there are already 3 entries selected, when you open the editor?

                Is this about unchecking/deselecting entries in a very long list?


                  Thanks Blama, Yes it is a long list of records. The attached, screenshot does not have any of the selected entries. But few may be selected. Hence, i need a filter for that.



                    my gut feeling is that you will have to have a DataSource "ListGridRecords cross join AttributeList" which shows which entries are selected via a Y/N, the ListGridRecord-ID and all columns from you attribute table. Then you can filter on that indicator field.
                    In the editor constructor you'd have to fit in the ListGridRecord-ID in order to only show the relevant list and also to effectively have a inner join-lookup.

                    Or: It is somehow possible to have checked entries displayed first in a multi-SelectItem, but I doubt that, since this would either mean loading the whole list or many lookup-calls when you open the Dropdown.

                    Or: Would this design work? This sample in mode "vertical"?

                    Best regards


                      This is working fine for the case when we filter by a value , and selects few rows there .
                      But in the case , when we filter by a value and de-selects some rows , then it shows me the values selected for that filter but removes the value already selected for other filters.