want to prevent table-search and colum-level-search to be saved in bStateSave

want to prevent table-search and colum-level-search to be saved in bStateSave

alamnaryabalamnaryab Posts: 4Questions: 3Answers: 0

I have below code working

   "bStateSave":true,
    "stateSaveParams": function (settings, data) {
        data.start = 0;
        data.search.search = "";
    },

it prevents table-level search to be saved, but I also want to prevent column-level-search
I tried below code but now no data is loading, I am getting error alert

    "stateSaveParams": function (settings, data) {
        data.start = 0;
        data.search.search = "";

        $.each(data.columns,function(i,v){
            v.search = "";
        });

    },

getting below error in consle may be some conflict with table-level search property
Uncaught TypeError: String.prototype.search called on null or undefined
at search (<anonymous>)

Answers

  • alamnaryabalamnaryab Posts: 4Questions: 3Answers: 0
    edited June 2021

    fixed this
    it was v.search.serarch

    $.each(data.columns,function(i,v){
        v.search.search = "";
    });
    

    please let me know if there is other optimized soultion

Sign In or Register to comment.