Column Search: multiple search terms for one column, criteria's separated by "," or any seperator

Column Search: multiple search terms for one column, criteria's separated by "," or any seperator

pushpinderpushpinder Posts: 4Questions: 1Answers: 0
edited July 2014 in Free community support

function _fnFilterColumn ( settings, searchStr, colIdx, regex, smart, caseInsensitive )
{
if (searchStr === '') {
return;
} else {

        var searchCriteria = searchStr.split('~');   // choose any Separator 
    }

    var data;
    var display = settings.aiDisplay;

    if (searchCriteria.length > 1) {

//Can be generalize for Array size Search Criteria's
// loop all the search criteria
var rpSearch = _fnFilterCreateSearch(searchCriteria[0], regex, smart, caseInsensitive);

        var rpSearch1 = _fnFilterCreateSearch(searchCriteria[1], regex, smart, caseInsensitive);


        for (var i = display.length - 1 ; i >= 0 ; i--) {
            data = settings.aoData[display[i]]._aFilterData[colIdx];

// Loop for No. of searches

                                    if (!rpSearch.test(data) & !rpSearch1.test(data)) {
                display.splice(i, 1);
            }
        }
    } else {

        var rpSearch = _fnFilterCreateSearch(searchStr, regex, smart, caseInsensitive);
        for (var i = display.length - 1 ; i >= 0 ; i--) {
            data = settings.aoData[display[i]]._aFilterData[colIdx];
            //alert(data);
            if (!rpSearch.test(data) ) {
                display.splice(i, 1);
            }
        }

    }
}

Replies

  • pushpinderpushpinder Posts: 4Questions: 1Answers: 0
    edited July 2014

    Column Search: multiple search terms for one column, criteria's separated by "," or any other separator

This discussion has been closed.