Row filter always shows select box for lookup column

I have a data grid where some of the columns are are configured to use lookups. For all these columns the row filter option shows a select box with the datasource same as the lookup column.

The issue with this implementation is that, even if the data in my grid does not have a record with one of the values from the lookup options, the option is visible in the row filter data source. Hence, if the user selects this option, no records will be displayed in the grid.

I thought of two possible solutions as below:

  • Filter the list on the row filter to show options based on the data grid records.
  • Instead of select box, keep default text box in the row filter.
  • In the first solution, the data is as per the lookup datasource and cannot be filtered.

    So I would like to implement the second solution but could not find any way to not display select box.

    It would be of great help if I can get a solution to remove the select box in the lookup column which I feel should be configurable.

    Also, other solutions are also welcome.


    Finally after posting a ticket with the devextreme development team, I found below solution:

    onEditorPreparing: function(e) {
       if(e.parentType == "filterRow" && e.dataField == "YourField") 
              e.editorName = "dxTextBox"
        /// or 
           e.editorOptions.dataSource = // set custom data here
     }
    

    Maybe some more documentation on their part would have helped.

    链接地址: http://www.djcxy.com/p/5246.html

    上一篇: 使用角度2设置devextreme DataGrid中日期列的格式

    下一篇: 行过滤器始终显示查找列的选择框