vendor/assets/javascripts/simple_datatables.js.coffee in simple_datatables-0.2.1 vs vendor/assets/javascripts/simple_datatables.js.coffee in simple_datatables-0.3.0

- old
+ new

@@ -53,11 +53,10 @@ sortcolumns[parseInt(col[1])]=columns[parseInt(dataObj.value)]; search_regexp = ///sSortDir_([0-9]+)/// if (col = dataObj.name.match(search_regexp)) and dataObj.value sortcolumns[col[1]]=sortcolumns[col[1]]+"."+dataObj.value; - ); data.push({name: "sEcho", value: sEcho}); data.push({name: "page", value: iDisplayStart/iDisplayLength + 1}); data.push({name: "per_page", value: iDisplayLength}); @@ -66,10 +65,13 @@ $.each(columns, (index, val) -> data.push({name: "columns["+index+"]", value: val}); ); if sSearch - op = bRegex ? "_contains" : "_sw" + if bRegex + op = "_contains" + else + op = "_sw" data.push({name: "search["+searchcolumns.join("_or_")+op+"]", value: sSearch}); $.ajax( { "dataType": 'json', "type": "GET", "url": sSource, "data": data, "success": fnCallback } ); \ No newline at end of file