src/Html/Options/HasData.php
public function minifiedAjax($url = '', $script = null, $data = [], $ajaxParameters = [])
    {
        $this->ajax = [];
        $appendData = $this->makeDataScript($data);

        $this->ajax['url'] = $url;
        $this->ajax['type'] = 'GET';
        if (isset($this->attributes['serverSide']) ? $this->attributes['serverSide'] : true) {
            $this->ajax['data'] = 'function(data) {
            for (var i = 0, len = data.columns.length; i < len; i++) {
                if (!data.columns[i].search.value) delete data.columns[i].search;
                if (data.columns[i].searchable === true) delete data.columns[i].searchable;
                if (data.columns[i].orderable === true) delete data.columns[i].orderable;
                if (data.columns[i].data === data.columns[i].name) delete data.columns[i].name;
            }
            delete data.search.regex;';
        } else {
            $this->ajax['data'] = 'function(data){';
        }

        if ($appendData) {
            $this->ajax['data'] .= $appendData;
        }

        if ($script) {
            $this->ajax['data'] .= $script;
        }

        $this->ajax['data'] .= '}';

        $this->ajax = array_merge($this->ajax, $ajaxParameters);

        return $this;
    }
public function minifiedAjax($url = '', $script = null, $data = [], $ajaxParameters = [])
    {
        $this->ajax = [];
        $appendData = $this->makeDataScript($data);

        $this->ajax['url'] = $url;
        $this->ajax['type'] = 'GET';
        if (isset($this->attributes['serverSide']) ? $this->attributes['serverSide'] : true) {
            $this->ajax['data'] = 'function(data) {
            for (var i = 0, len = data.columns.length; i < len; i++) {
                if (!data.columns[i].search.value) delete data.columns[i].search;
                if (data.columns[i].searchable === true) delete data.columns[i].searchable;
                if (data.columns[i].orderable === true) delete data.columns[i].orderable;
                if (data.columns[i].data === data.columns[i].name) delete data.columns[i].name;
            }
            delete data.search.regex;';
        } else {
            $this->ajax['data'] = 'function(data){';
        }

        if ($appendData) {
            $this->ajax['data'] .= $appendData;
        }

        if ($script) {
            $this->ajax['data'] .= $script;
        }

        $this->ajax['data'] .= '}';

        $this->ajax = array_merge($this->ajax, $ajaxParameters);

        return $this;
    }
public function minifiedAjax ( $ url = '' , $ script = null , $ data = [ ] , $ ajaxParameters = [ ] ) { $ this -> ajax = [ ] ; $ appendData = $ this -> makeDataScript ( $ data ) ; $ this -> ajax [ 'url' ] = $ url ; $ this -> ajax [ 'type' ] = 'GET' ; if ( isset ( $ this -> attributes [ 'serverSide' ] ) ? $ this -> attributes [ 'serverSide' ] : true ) { $ this -> ajax [ 'data' ] = 'function(data) {
            for (var i = 0, len = data.columns.length; i < len; i++) {
                if (!data.columns[i].search.value) delete data.columns[i].search;
                if (data.columns[i].searchable === true) delete data.columns[i].searchable;
                if (data.columns[i].orderable === true) delete data.columns[i].orderable;
                if (data.columns[i].data === data.columns[i].name) delete data.columns[i].name;
            }
            delete data.search.regex;' ; } else { $ this -> ajax [ 'data' ] = 'function(data){' ; } if ( $ appendData ) { $ this -> ajax [ 'data' ] .= $ appendData ; } if ( $ script ) { $ this -> ajax [ 'data' ] .= $ script ; } $ this -> ajax [ 'data' ] .= '}' ; $ this -> ajax = array_merge ( $ this -> ajax , $ ajaxParameters ) ; return $ this ; }
Minify ajax url generated when using get request
by deleting unnecessary url params.

@param string $url
@param string $script
@param array $data
@param array $ajaxParameters
@return $this
Minify ajax url generated when using get request by deleting unnecessary url params .