Column search/filter pull-down menu width for columns with line breaks

Column search/filter pull-down menu width for columns with line breaks

kirkiljkirkilj Posts: 1Questions: 1Answers: 0

If a column has cells with explicit line breaks, the column search/filter pull-down menu's width is determined by the longest concatenated length of the lines in the column's cells.

  1. Is there a way to limit the width of the pull-down from its automatic width determination by CSS or otherwise?
  2. Perhaps alternatively, is there a way to apply a function to the values used to construct the pull down to truncate the value at the first line break, if there is one, so only the first line of a cell is considered when producing a list of unique column values?

Answers

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,945

    Is there a way to limit the width of the pull-down from its automatic width determination by CSS or otherwise?

    See if this thread answers your question.

    Perhaps alternatively, is there a way to apply a function to the values used to construct the pull down to truncate the value at the first line break, if there is one, so only the first line of a cell is considered when producing a list of unique column values?

    Assuming you are using something like this example you can update this code to adjust the text displayed.

                    // Add list of options
                    column
                        .data()
                        .unique()
                        .sort()
                        .each(function (d, j) {
                            select.append(
                                '<option value="' + d + '">' + d + '</option>'
                            );
                        });
    

    Kevin

Sign In or Register to comment.