columControl search input responds only when Enter is pressed.

columControl search input responds only when Enter is pressed.

waalwaal Posts: 2Questions: 1Answers: 0

I have a problem using columnControl with server-side processing, the searchInput responds to key change causing calling ajax for each key pressed on the keyboard.. this behavior costs server calls.
For fields that has a set of values, searchList can be used instead, but for fields that may not have a list such as numeric values, it would be more convenient that search input responds only if 'Enter' is pressed, or at least we have the option to force search { enter: true} to be implemented on columnControl search input.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 65,752Questions: 1Answers: 10,936 Site admin

    I'm afraid that at the moment, ColumnControl doesn't follow either the enter option or searchDelay. I will look at adding that. Thank you for highlighting that.

    Allan

  • waalwaal Posts: 2Questions: 1Answers: 0

    @allan Thanks for your response, it is really very good component that saved my time and effort.. I managed to solve my problem by modifying columnControl file like this..

        var inputInput = function (e) {
            if (e.key === 'Enter') {
                _this.runSearch();
            }
        };
        var selectInput = function () {
            dom.typeIcon.innerHTML = icons[dom.select.value];
            _this.runSearch();
        };
        var clearClick = function () {
            _this.clear();
        };
        dom.input.addEventListener('keydown', inputInput);
        dom.select.addEventListener('input', selectInput);
        dom.clear.addEventListener('click', clearClick);
        dt.on('destroy', function () {
            dom.input.removeEventListener('keydown', inputInput);
            dom.select.removeEventListener('input', selectInput);
            dom.clear.removeEventListener('click', clearClick);
        });
    

    I know it might not the optimal solution but it worked for me.

  • allanallan Posts: 65,752Questions: 1Answers: 10,936 Site admin
    Answer ✓

    Looks good to me! It doesn't consider the configuration parameters, but that doesn't sounds like something you need. I'll look at getting this ability into ColumnControl as I think it is a useful thing to add.

    Allan

Sign In or Register to comment.