Skip to content

Commit

Permalink
Implemented vitmalina#1323
Browse files Browse the repository at this point in the history
  • Loading branch information
mrg2001 committed Aug 30, 2016
1 parent 25710f5 commit c1b71dd
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/w2grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
"date" : ['is', 'between', { oper: 'less', text: 'before'}, { oper: 'more', text: 'after' }],
"list" : ['is'],
"hex" : ['is', 'between'],
"color" : ['is', 'begins', 'contains', 'ends'],
"enum" : ['in', 'not in']
// -- all posible
// "text" : ['is', 'begins', 'contains', 'ends'],
Expand All @@ -363,7 +364,7 @@
"percent" : "number",
"hex" : "hex",
"alphanumeric" : "text",
"color" : "text",
"color" : "color",
"date" : "date",
"time" : "date",
"datetime" : "date",
Expand Down Expand Up @@ -1859,7 +1860,7 @@
var search = this.searches[i];
if ( search.type == 'text' || (search.type == 'alphanumeric' && w2utils.isAlphaNumeric(value))
|| (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 == 'percent' && w2utils.isFloat(value)) || ((search.type == 'hex' || search.type == 'color') && w2utils.isHex(value))
|| (search.type == 'currency' && w2utils.isMoney(value)) || (search.type == 'money' && w2utils.isMoney(value))
|| (search.type == 'date' && w2utils.isDate(value)) || (search.type == 'time' && w2utils.isTime(value))
|| (search.type == 'datetime' && w2utils.isDateTime(value)) || (search.type == 'enum' && w2utils.isAlphaNumeric(value))
Expand Down Expand Up @@ -5923,10 +5924,14 @@
case 'text':
case 'alphanumeric':
case 'hex':
case 'color':
case 'list':
case 'combo':
case 'enum':
html += '<input rel="search" type="text" size="40" class="w2ui-input" style="'+ s.style +'" id="grid_'+ this.name +'_field_'+ i +'" name="'+ s.field +'" '+ s.inTag +'/>';
var tmpStyle = 'width: 250px;';
if (['hex', 'color'].indexOf(s.type) != -1) tmpStyle = 'width: 90px;';
html += '<input rel="search" type="text" id="grid_'+ this.name +'_field_'+ i +'" name="'+ s.field +'" '+
' class="w2ui-input" style="'+ tmpStyle + s.style +'" '+ s.inTag +'/>';
break;

case 'int':
Expand All @@ -5937,10 +5942,11 @@
case 'date':
case 'time':
case 'datetime':
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" size="'+ size +'" style="'+ s.style +'" id="grid_'+ this.name +'_field2_'+i+'" name="'+ s.field +'" '+ s.inTag +'/>'+
var tmpStyle = 'width: 90px';
if (s.type == 'datetime') tmpStyle = 'width: 140px;';
html += '<input rel="search" type="text" class="w2ui-input" style="'+ tmpStyle + 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="'+ tmpStyle + s.style +'" id="grid_'+ this.name +'_field2_'+ i +'" name="'+ s.field +'" '+ s.inTag +'/>'+
'</span>';
break;

Expand Down Expand Up @@ -6044,6 +6050,7 @@
case 'int':
case 'float':
case 'hex':
case 'color':
case 'money':
case 'currency':
case 'percent':
Expand Down

0 comments on commit c1b71dd

Please sign in to comment.