Skip to content

Commit

Permalink
search optimizations
Browse files Browse the repository at this point in the history
added || (search.type == 'time' && w2utils.isTime(value)),
common style and size for second "between" field in search
  • Loading branch information
mpf82 committed Jul 7, 2016
1 parent d93edea commit 86718d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/w2grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,8 @@
|| (search.type == 'int' && w2utils.isInt(value)) || (search.type == 'float' && w2utils.isFloat(value))
|| (search.type == 'percent' && w2utils.isFloat(value)) || (search.type == 'hex' && w2utils.isHex(value))
|| (search.type == 'currency' && w2utils.isMoney(value)) || (search.type == 'money' && w2utils.isMoney(value))
|| (search.type == 'date' && w2utils.isDate(value)) || (search.type == 'datetime' && w2utils.isDateTime(value))
|| (search.type == 'date' && w2utils.isDate(value)) || (search.type == 'time' && w2utils.isTime(value))
|| (search.type == 'datetime' && w2utils.isDateTime(value))
) {
var tmp = {
field : search.field,
Expand Down Expand Up @@ -5931,9 +5932,10 @@
case 'date':
case 'time':
case 'datetime':
html += '<input rel="search" type="text" size="12" class="w2ui-input" style="'+ s.style +'" id="grid_'+ this.name +'_field_'+ i +'" name="'+ s.field +'" '+ s.inTag +'/>'+
var size = (s.type === 'datetime') ? 17 : 12;
html += '<input rel="search" type="text" size="'+ size +'" class="w2ui-input" style="'+ s.style +'" id="grid_'+ this.name +'_field_'+ i +'" name="'+ s.field +'" '+ s.inTag +'/>'+
'<span id="grid_'+ this.name +'_range_'+ i +'" style="display: none">'+
'&#160;-&#160;&#160;<input rel="search" type="text" class="w2ui-input" style="width: 90px" id="grid_'+ this.name +'_field2_'+i+'" name="'+ s.field +'" '+ s.inTag +'/>'+
'&#160;-&#160;&#160;<input rel="search" type="text" class="w2ui-input" size="'+ size +'" style="'+ s.style +'" id="grid_'+ this.name +'_field2_'+i+'" name="'+ s.field +'" '+ s.inTag +'/>'+
'</span>';
break;

Expand Down

0 comments on commit 86718d2

Please sign in to comment.